Some of my scripts written under v4.x use both LOGNAME and USER variables.
Under v5.x some of the scripts are failing due to an apparent difference in
the way that su modifies the environment. Has anyone else run into this?
Under v5.x the LOGNAME variable isn't set to the effective username after an
su, it stays the original username. Here's an example :
v4.0e :
$ env | grep LOGNAME
LOGNAME=davis
$ env | grep USER
USER=davis
$ su - sysdavis
Password:
# env | grep LOGNAME
LOGNAME=sysdavis
# env | grep USER
USER=sysdavis
v5.1 :
$ env | grep LOGNAME
LOGNAME=davis
$ env | grep USER
USER=davis
$ su - sysdavis
Password:
# env | grep LOGNAME
LOGNAME=davis
# env | grep USER
USER=sysdavis
The manpage for su has been modified, but it doesn't accurately describe the
effect of su on the LOGNAME variable.
Alan Davis
davis_at_tessco.com
Received on Fri Mar 30 2001 - 14:51:10 NZST