Got the answer:

An su to root creates the environment variable $USERNAME=root. The value
of $USER is not changed.   Leaving the superuser state (exit or ^D)
removes $USERNAME.

This is a change in 8.2 which Mandrake users have NOT been responsibly
notified of beforehand.

What others are there?


Ron Stodden wrote:
> 
> What seems like another problem with 8.2 ...
> 
> Security is standard.
> 
> If I log in as user 'ron'. as is usual, and do:
> 
> users
> 
> I get:
> 
> ron
> 
> which is OK.  If I now su to root, users does not change.  It used to
> say:
> 
> ron root
> 
> if I now say:
> 
> whoami
> 
> I get:
> 
> root
> 
> which is correct.
> 
> If I now run a script, $USER delivers "ron", not the "root" which
> previous Mandrakes delivered.
> 
> So just exactly what is going on, please?
> 
> Question: How do I get the current real user name from inside a bash
> script?
> 
> --
> Ron. [au]

-- 
Ron. [au]

Kindly note my new email address: [EMAIL PROTECTED]
and new web site: http://www.ains.net.au/~ronst/

Reply via email to