Mark __clockctl_fd close-on-exec to avoid unintentionally leaking
time setting privileges across an exec.
This commit is contained in:
parent
8fece4c5f9
commit
9b28f9c625
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adjtime.c,v 1.4 2003/01/18 11:33:01 thorpej Exp $ */
|
||||
/* $NetBSD: adjtime.c,v 1.5 2003/07/16 19:42:11 cb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -107,6 +107,7 @@ try_syscall:
|
||||
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY, 0);
|
||||
if (__clockctl_fd == -1)
|
||||
return -1;
|
||||
(void) fcntl(__clockctl_fd, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: clock_settime.c,v 1.4 2003/01/18 11:33:02 thorpej Exp $ */
|
||||
/* $NetBSD: clock_settime.c,v 1.5 2003/07/16 19:42:11 cb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -109,6 +109,7 @@ try_syscall:
|
||||
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY, 0);
|
||||
if (__clockctl_fd == -1)
|
||||
return -1;
|
||||
(void) fcntl(__clockctl_fd, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ntp_adjtime.c,v 1.4 2003/01/18 11:33:09 thorpej Exp $ */
|
||||
/* $NetBSD: ntp_adjtime.c,v 1.5 2003/07/16 19:42:11 cb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -111,6 +111,7 @@ try_syscall:
|
||||
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY, 0);
|
||||
if (__clockctl_fd == -1)
|
||||
return -1;
|
||||
(void) fcntl(__clockctl_fd, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: settimeofday.c,v 1.4 2003/01/18 11:33:13 thorpej Exp $ */
|
||||
/* $NetBSD: settimeofday.c,v 1.5 2003/07/16 19:42:11 cb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -109,6 +109,7 @@ try_syscall:
|
||||
__clockctl_fd = open(_PATH_CLOCKCTL, O_WRONLY, 0);
|
||||
if (__clockctl_fd == -1)
|
||||
return -1;
|
||||
(void) fcntl(__clockctl_fd, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user