* src/su.c: Fix handling of environment variables when
the environment is not changed. In particular, this makes su behave as documented regarding PATH and IFS (i.e. they are reset) when -p is provided.
This commit is contained in:
parent
bf480028f5
commit
991ce97170
@ -1,3 +1,10 @@
|
|||||||
|
2010-08-28 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/su.c: Fix handling of environment variables when
|
||||||
|
the environment is not changed. In particular, this makes su
|
||||||
|
behave as documented regarding PATH and IFS (i.e. they are reset)
|
||||||
|
when -p is provided.
|
||||||
|
|
||||||
2010-08-28 Nicolas François <nicolas.francois@centraliens.net>
|
2010-08-28 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* man/su.1.xml: Fix typo.
|
* man/su.1.xml: Fix typo.
|
||||||
|
12
src/su.c
12
src/su.c
@ -933,13 +933,13 @@ int main (int argc, char **argv)
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (change_environment) {
|
/* we need to setup the environment *after* pam_open_session(),
|
||||||
/* we need to setup the environment *after* pam_open_session(),
|
* else the UID is changed before stuff like pam_xauth could
|
||||||
* else the UID is changed before stuff like pam_xauth could
|
* run, and we cannot access /etc/shadow and co
|
||||||
* run, and we cannot access /etc/shadow and co
|
*/
|
||||||
*/
|
environ = newenvp; /* make new environment active */
|
||||||
environ = newenvp; /* make new environment active */
|
|
||||||
|
|
||||||
|
if (change_environment) {
|
||||||
/* update environment with all pam set variables */
|
/* update environment with all pam set variables */
|
||||||
envcp = pam_getenvlist (pamh);
|
envcp = pam_getenvlist (pamh);
|
||||||
if (NULL != envcp) {
|
if (NULL != envcp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user