summaryrefslogtreecommitdiff
path: root/lib/libc/sys/execve.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/execve.2')
-rw-r--r--lib/libc/sys/execve.27
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2
index de7a0dc8ee2..023d232d499 100644
--- a/lib/libc/sys/execve.2
+++ b/lib/libc/sys/execve.2
@@ -115,6 +115,13 @@ and
.Xr fcntl 2 ) .
Descriptors that remain open are unaffected by
.Fn execve .
+In the case of a new setuid or setgid executable being executed, if
+file descriptors 0, 1, or 2 (representing stdin, stdout, and stderr)
+are currently unallocated, these descriptors will be opened to point to
+some system file like
+.Pa /dev/null .
+The intent is to ensure these descriptors are not unallocated, since
+many libraries make assumptions about the use of these 3 file descriptors.
.Pp
Signals set to be ignored in the calling process are set to be ignored in
the