diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-09-21 18:47:28 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-09-21 18:47:28 -0400 |
commit | 2e918d33be152c1a57ffb3ff53e344cafb161a8c (patch) | |
tree | 1549a3e1be09d4e565bfa58de0c03191e3d4e718 /parse.c | |
parent | 10cb15e914bcf9257f14e09302fb4ab5b0aaf348 (diff) | |
download | bfs-2e918d33be152c1a57ffb3ff53e344cafb161a8c.tar.xz |
util: New xfopen() utility
And use it to pass O_CLOEXEC to all FILE*'s, so the files opened for
-fprint etc. don't get passed to the programs run by -exec etc.
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1278,7 +1278,7 @@ static struct expr *parse_files0_from(struct parser_state *state, int arg1, int if (strcmp(from, "-") == 0) { file = stdin; } else { - file = fopen(from, "rb"); + file = xfopen(from, O_RDONLY | O_CLOEXEC); } if (!file) { parse_error(state, "${blu}%s${rs} ${bld}%s${rs}: %m.\n", arg, from); |