FS#49885 - [util-linux] /etc/environment not sourced by `su -` (with hyphen)

Attached to Project: Arch Linux
Opened by ilya (leniviy) - Wednesday, 29 June 2016, 11:29 GMT
Last edited by Toolybird (Toolybird) - Friday, 26 May 2023, 07:00 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

/etc/environment is sourced, when you login using text console, desktop manager or ssh, but not sourced by the command `su -` (with hyphen).
This is because pam_env module not mentioned in /etc/pam.d/su-l

I expect that issuing `su -` will have the same effect as logging in using other methods.

Please append extra line to the default config file /etc/pam.d/su-l :

session required pam_env.so

Additional info:
* package version(s)
util-linux 2.28-1

Steps to reproduce:

- put the following in /etc/environment :

AAABBB=cccddd

- login using text console
- ensure the variable is set:

$ echo $AAABBB
cccddd

- login using su - :

$ su -
Password:
#

- ensure the variable is not set:

# echo $AAABBB

#
This task depends upon

Closed by  Toolybird (Toolybird)
Friday, 26 May 2023, 07:00 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Old and stale. As per  FS#40633 , anyone who needs this can just configure it in /etc/pam.d/*
Comment by Doug Newgard (Scimmia) - Thursday, 30 June 2016, 04:22 GMT
Is this covered by  FS#40633 ?
Comment by ilya (leniviy) - Thursday, 30 June 2016, 05:25 GMT
Maybe. I think the files /etc/pam.d/su and /etc/pam.d/su-l should have different contents. `su` without hyphen should preserve the current environment and probably should not call pam_env.
Comment by Greg (skimj) - Wednesday, 07 December 2016, 22:17 GMT
Likewise, the /etc/security/pam_env.conf is only sourced with the line
`session required pam_env.so` and I expected that to happen for `su -l` (but not necessarily just `su`).

Loading...