Operating System - HP-UX
1834714 Members
2389 Online
110069 Solutions
New Discussion

"who am i" and "logname" commands not working with sudosh

 
Anthony_141
Regular Advisor

"who am i" and "logname" commands not working with sudosh

We installed sudosh a few weeks ago and recently noticed that now "logname" and "who am i" no longer function.

The "clearenvironment" paramater in sudosh is normally set to "yes" so we tried "no" and this didn't help.

Just curious if anyone else has run into this.
5 REPLIES 5
OFC_EDM
Respected Contributor

Re: "who am i" and "logname" commands not working with sudosh

What error do you get when you try the commands?
The Devil is in the detail.
Anthony_141
Regular Advisor

Re: "who am i" and "logname" commands not working with sudosh

"who am i" returns nothing

"logname" returns:
logname could not get login name

Note that "whoami" works but not "who am i".

Steven E. Protter
Exalted Contributor

Re: "who am i" and "logname" commands not working with sudosh

Shalom,

sudo should have no impact on these commands to root user.

Do you have setup involving these two commands for non-root users?

To help, I'd need to see snippets from your sudoers file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Anthony_141
Regular Advisor

Re: "who am i" and "logname" commands not working with sudosh

We don't have sudo installed -we're just using sudosh as a login shell.
Dennis Handly
Acclaimed Contributor

Re: "who am i" and "logname" commands not working with sudosh

>who am i" returns nothing
>"logname" returns: logname could not get login name

Perhaps sudosh doesn't change the real and effective users to the new user?
whoami(1) returns the effective user.

logname(1) and who(1) probably get their info from getlogin(3) which seems to
look at utmpd. Perhaps utmpd doesn't have the info?
(And logname(1) does error checking.)