'su' corrupting environ vars ?

From: Massimo Gais <mgais_at_na.astro.it>
Date: Fri, 14 Apr 2000 13:22:21 +0200 (MET DST)

Hello Tru64 managers,

I found a weird problem with 'su', that is it looks like it's trashing
some environment variables.

The 'man su' says:
  Except in a case where the - option is used, the user environment is
  unchanged except for HOME, SHELL, USER, and LOGNAME which are taken from
  the password file for the user being substituted (see environ).
  
Notably, this happens to me with LD_LIBRARY_PATH.

Please read here:

mgais % LD_LIBRARY_PATH=/usr/lib:/usr/lib/X11:/usr/shlib
mgais % export LD_LIBRARY_PATH
mgais % echo $LD_LIBRARY_PATH
/usr/lib:/usr/lib/X11:/usr/shlib

and now...

mgais % su
Password:
# echo $LD_LIBRARY_PATH
ÿ53ÿ141ÿ/usr/lib:/usr/lib/X11:/usr/shlib

With 'od' I could see that those weird chars are:
0xff _userUID_ 0xff _userGID_ 0xff

The problem is the same if I start with sh/bash/csh user shell
Root shell is sh

The problem seems to affect only for DU v4.0d/v4.0f machines,
not for Tru64 v5.0

If I type 'su otheruser', (with a sh/bash user) the
LD_LIBRARY_PATH will be unset

Of course, if I type 'su -', the variable is re-initialized correctly.

Could you please check if on your machine there is such a problem,
or if it should be something related to my login scripts ?

Thank you in advance

Massimo Gais <mgais_at_na.astro.it>
----
			"UNIX is user friendly. It's just selective 
				about who its friends are..." 
Received on Fri Apr 14 2000 - 11:23:07 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT