Skip to content

Commit

Permalink
Use FD_CLOEXEC instead of just 1
Browse files Browse the repository at this point in the history
  • Loading branch information
millert committed Aug 3, 2024
1 parent f6064b0 commit 1381a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/sudoers/sudoers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ open_sudoers(const char *path, char **outfile, bool doedit, bool *keepopen)
} else {
/* Rewind fp and set close on exec flag. */
rewind(fp);
(void)fcntl(fileno(fp), F_SETFD, 1);
(void)fcntl(fileno(fp), F_SETFD, FD_CLOEXEC);
if (outfile != NULL) {
*outfile = sudo_rcstr_dup(fname);
if (*outfile == NULL) {
Expand Down

0 comments on commit 1381a69

Please sign in to comment.