Bugzilla – Bug 848
-i / --login on AIX does not initialize LOGIN environment variable like su -
Last modified: 2018-09-05 06:27:52 MDT
From the AIX login command manual: The login command also sets the LOGIN and LOGNAME environment variables. sudoers(5) does not mention the LOGIN environment variable. From the AIX su command manual, the hyphen flag: Specifies that the process environment is to be set as if the user had logged in to the system using the login command. Nothing in the current environment is propagated to the new shell. Example: $ su - -c env | sort > su.env root's Password: $ sudo -i env | sort > sudo.env $ comm -23 su.env sudo.env AUTHSTATE=compat LOGIN=root $ comm -13 su.env sudo.env | grep -v '^SUDO_' USERNAME=root $ uname AIX $ oslevel -s 7200-02-02-1832 $ sudo lssec -f /etc/security/login.cfg -s usw -a auth_type usw auth_type=STD_AUTH $ find /usr/*bin -inum $(ls -i /usr/sbin/login | awk '{print $1}') /usr/sbin/getty /usr/sbin/login /usr/sbin/tsm $
Possible work arounds include using $USER or $(/usr/bin/id -un) instead of $LOGIN in login scripts.
LOGIN appears to be AIX-specific. I'll look into adding support for it to sudo 1.8.25
Fixed in sudo 1.8.25