environ.7: Various edits to Bastien Roucariès's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-01-30 08:54:25 +01:00
parent 37147e18b6
commit 241b015a62
1 changed files with 12 additions and 15 deletions

View File

@ -280,28 +280,25 @@ and
operations can be used to control the location of the process's environment.
.PP
The
.B HOME,
.B LOGNAME,
.B SHELL
.BR HOME ,
.BR LOGNAME ,
.BR SHELL ,
and
.B USER
variables are only set when an user is changing using
session management interface, typically by program
variables are set when the user is changed via a
session management interface, typically by a program such as
.B login(1)
from user database (for instance, but not limited, by using
.B password (5)
database).
Particularly,
.BR setuid (2)
family of function
does not set theses variables. Notes that as documented,
going to root by
.BR su (8)
from a user database (such as
.BR passwd (5)).
(Switching to the root user using
.BR su (1)
may result in a mixed environment where
.B LOGNAME
and
.B USER
are retained from old user.
are retained from old user; see the
.BR su (1)
manual page.)
.SH BUGS
Clearly there is a security risk here.
Many a system command has been