]> git.ipfire.org Git - thirdparty/util-linux.git/commit - configure.ac
su: add --whitelist-environment
authorKarel Zak <kzak@redhat.com>
Fri, 10 Aug 2018 08:49:15 +0000 (10:49 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 15 Aug 2018 11:03:21 +0000 (13:03 +0200)
commit75efef98d4ca2281bd4f8d1a1ddf8805bb024984
tree3fed4f5aad4fb00fdf58ded417a70cb9171bc74a
parentdf5ccf25895699725e91059d725287b5544c8b05
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>
configure.ac
login-utils/runuser.1
login-utils/su-common.c
login-utils/su.1