Matts has asked for the wisdom of the Perl Monks concerning the following question:
The solution I was using was to just check $ENV{LOGNAME}. However it seems this isn't set to the logged in user when the user types "su -" instead of plain old "su".
I know this can be done, because /usr/bin/ftp does it (when you ftp to some site, it still gives you the option of using the username you logged in as for the remote username). Does ftp just traverse up the process tree until it finds a process not owned by root, or ultimately finds init?
Any help to solve this greatly appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get the logged in user id
by Zaxo (Archbishop) on May 29, 2002 at 13:42 UTC | |
|
Re: How to get the logged in user id
by jeffenstein (Hermit) on May 29, 2002 at 14:10 UTC | |
by Matts (Deacon) on May 29, 2002 at 15:01 UTC | |
|
Re: How to get the logged in user id
by rob_au (Abbot) on May 30, 2002 at 12:05 UTC |