Skip to content

Commit 3ac7fec

Browse files
authored
Merge pull request #2541 from sshambar/patch-3
core: add O_CLOEXEC flag to pidfiles
2 parents 0968d4c + bd852ce commit 3ac7fec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

keepalived/core/pidfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ create_pidfile(pidfile_t *pidf)
167167
if (umask_val & (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))
168168
umask(umask_val & ~(S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH));
169169

170-
while ((pidf->fd = open(pidf->path, O_NOFOLLOW | O_CREAT | O_WRONLY | O_NONBLOCK, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1 && errno == EINTR);
170+
while ((pidf->fd = open(pidf->path, O_NOFOLLOW | O_CREAT | O_WRONLY | O_NONBLOCK | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1 && errno == EINTR);
171171
error = errno;
172172

173173
/* Restore the default umask */

0 commit comments

Comments
 (0)