On Mon, Nov 12, 2012 at 16:38, Alessandro Baggi wrote: > Logging in with an user called "userlog", get su, run passwd as root, it > says that i'm changing password for userlog. > > From manual page I get: > > > By default, the environment is unmodified with the exception of > LOGNAME, > HOME, SHELL, and USER. HOME and SHELL are set to the target login's > default values. LOGNAME and USER are set to the target login, > unless the > target login has a user ID of 0 and the -l flag was not specified, in > which case it is unmodified. The invoked shell is the target login's. > This is the traditional behavior of su
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ That's the way it used to work, that's the way it's going to work. > > Running "su -l" works good. > > Why if user ID is == 0 or if there's no -l, the $USER will not be set? > What is the policy?