diff options
author | Karel Zak | 2018-08-10 10:49:15 +0200 |
---|---|---|
committer | Karel Zak | 2018-08-15 13:03:21 +0200 |
commit | 75efef98d4ca2281bd4f8d1a1ddf8805bb024984 (patch) | |
tree | 3fed4f5aad4fb00fdf58ded417a70cb9171bc74a /login-utils/runuser.1 | |
parent | build-sys: fix typo in man install (diff) | |
download | kernel-qcow2-util-linux-75efef98d4ca2281bd4f8d1a1ddf8805bb024984.tar.gz kernel-qcow2-util-linux-75efef98d4ca2281bd4f8d1a1ddf8805bb024984.tar.xz kernel-qcow2-util-linux-75efef98d4ca2281bd4f8d1a1ddf8805bb024984.zip |
su: add --whitelist-environment
* usable with --login to whitelist specified environment variables
* the list is ignored for the core variables like HOME, SHELL, USER,
LOGNAME and PATH (su --login always resets these variables)
Note that su(1) requires password and after successful authentication
user has full control over the session, so he can set arbitrary
environment variables. The whitelist makes things more user friendly
only.
The patch removes unnecessary optimization when allocate environ[]. It
seems better to keep all in glibc hands and just reset the environment
array only.
Addresses: https://github.com/karelzak/util-linux/issues/221
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/runuser.1')
-rw-r--r-- | login-utils/runuser.1 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/login-utils/runuser.1 b/login-utils/runuser.1 index 40b6f9b3a..af834e840 100644 --- a/login-utils/runuser.1 +++ b/login-utils/runuser.1 @@ -82,6 +82,7 @@ login: o clears all the environment variables except for .B TERM +and variables specified by \fB\-\-whitelist\-environment\fR .TP o initializes the environment variables @@ -144,6 +145,15 @@ Same as .B \-c , but do not create a new session. (Discouraged.) .TP +.BR \-w , " \-\-whitelist\-environment" = \fIlist +Don't reset environment variables specified in comma separated \fIlist\fR when clears +environment for \fB\-\-login\fR. The whitelist is ignored for the environment variables +.BR HOME , +.BR SHELL , +.BR USER , +.BR LOGNAME ", and" +.BR PATH "." +.TP .BR \-V , " \-\-version" Display version information and exit. .TP |