Re: User who invoke doas

2019-05-02 Thread Nick Holland
On 5/2/19 8:04 AM, Ted Unangst wrote: > Nick Holland wrote: >> > In a shell script invoked by doas, is it possible to find which user >> > invoke the script? my search a the moment has come up empty. >> >> most likely place would be an environment variable, right? > >> >> # echo "I started o

Re: User who invoke doas

2019-05-02 Thread Frank Shute
On Thu, May 02, 2019 at 04:29:20AM +, Adam Steen wrote: > > Hi > > In a shell script invoked by doas, is it possible to find which user > invoke the script? my search a the moment has come up empty. > > Cheers Adam > Hi Adam, Nowadays, I think the POSIX way is considered to be id(1) with

Re: User who invoke doas

2019-05-02 Thread Ted Unangst
Nick Holland wrote: > > In a shell script invoked by doas, is it possible to find which user > > invoke the script? my search a the moment has come up empty. > > most likely place would be an environment variable, right? > > # echo "I started out as $LOGNAME" > I started out as nick Not

Re: User who invoke doas

2019-05-02 Thread Adam Steen
On Thu, May 2, 2019 at 20:17, Nick Holland wrote: > On 5/1/19 10:28 PM, Adam Steen wrote: >> Hi >> >> In a shell script invoked by doas, is it possible to find which user >> invoke the script? my search a the moment has come up empty. > > most likely place would be an environment variable, right?

Re: User who invoke doas

2019-05-02 Thread Nick Holland
On 5/1/19 10:28 PM, Adam Steen wrote: > Hi > > In a shell script invoked by doas, is it possible to find which user > invoke the script? my search a the moment has come up empty. most likely place would be an environment variable, right? So ... $ whoami nick $ doas -s # whoami

Re: User who invoke doas

2019-05-01 Thread Andreas Kusalananda Kähäri
On Thu, May 02, 2019 at 04:29:20AM +, Adam Steen wrote: > Hi > > In a shell script invoked by doas, is it possible to find which user invoke > the script? my search a the moment has come up empty. > > Cheers > Adam > Investigate the owner of the shell's parent process: ps -p $PPID -o user

Re: User who invoke doas

2019-05-01 Thread Benny
If there is only one user running the script, can ps -A | grep "script_name" work? ‐‐‐ Original Message ‐‐‐ On Wednesday, May 1, 2019 9:29 PM, Adam Steen wrote: > Hi > > In a shell script invoked by doas, is it possible to find which user invoke > the script? my search a the moment has

User who invoke doas

2019-05-01 Thread Adam Steen
Hi In a shell script invoked by doas, is it possible to find which user invoke the script? my search a the moment has come up empty. Cheers Adam