aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2023-03-14 17:02:07 +0000
committerWarner Losh <imp@FreeBSD.org>2023-03-25 17:06:13 +0000
commitd5df268584209c448d2e3f344b8b15c944e48b82 (patch)
tree2d065ceb7150bf92781af8719824679e09c743bb
parent72f501d07a02028a51c15614f7ac4482ce8345bd (diff)
downloadsrc-d5df268584209c448d2e3f344b8b15c944e48b82.tar.gz
src-d5df268584209c448d2e3f344b8b15c944e48b82.zip
secure_getenv: Improve documentation wording
Improve the documentation wording to be more consistent with FreeBSD manual pages. Suggested by: mjg (though reworded) Sponsored by: Netflix
-rw-r--r--lib/libc/stdlib/getenv.330
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
index 93c0d2ada6ad..46736635da47 100644
--- a/lib/libc/stdlib/getenv.3
+++ b/lib/libc/stdlib/getenv.3
@@ -32,7 +32,7 @@
.\" @(#)getenv.3 8.2 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd March 13, 2023
+.Dd March 14, 2023
.Dt GETENV 3
.Os
.Sh NAME
@@ -81,19 +81,16 @@ to by the
.Fn getenv
function.
.Pp
-The GNU-specific function,
-.Fn secure_getenv
-wraps the
-.Fn getenv
-function to prevent it from being run in "secure execution".
-Unlike in glibc,
+The
.Fn secure_getenv
-only checks if the
-.Fa setuid
-and
-.Fa setgid
-bits have been set or changed.
-These checks are subject to extension and change.
+returns
+.Va NULL
+when the environment cannot be trusted, otherwise it acts like
+.Fn getenv .
+The environment currently is not trusted when
+.Xr issetugid 3
+returns a non-zero value, but other conditions may be added
+in the future.
.Pp
The
.Fn setenv
@@ -222,6 +219,9 @@ and
.Fn unsetenv
functions conforms to
.St -p1003.1-2001 .
+The
+.Fn secure_getenv
+function is expected to be glibc-compatible.
.Sh HISTORY
The functions
.Fn setenv
@@ -249,7 +249,9 @@ specification.
.Pp
The
.Fn clearenv
-was added in
+and
+.Fn secure_getenv
+functions were added in
.Fx 14 .
.Sh BUGS
Successive calls to