From 1381a69f59c4a158e2f7ac92fc521710ada18ad0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 2 Aug 2024 19:48:41 -0600 Subject: [PATCH] Use FD_CLOEXEC instead of just 1 --- plugins/sudoers/sudoers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 987514f7c..70a0c1a52 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -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) {