|
Bugzilla – Full Text Bug Listing |
| Summary: | sudo 1.7.4p4 yields incorrect who -m (who am i) output | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Kent Squires <ksquire> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | ||
| Priority: | low | ||
| Version: | 1.7.4 | ||
| Hardware: | IBM | ||
| OS: | AIX | ||
|
Description
Kent Squires
2010-12-10 15:16:54 MST
it doesn't appear to be working under Linux either: under Red Hat Enterprise Linux AS release 4 $ sudo who am i $ (no output) This doesn't sound like a sudo problem to me. I've tried sudo 1.7.4p4 on both AIX 5.3 and RHEL 4 and "who am i" behaves as expected. -bash-3.1$ uname -a AIX vasaix53 3 5 0000C68AD300 -bash-3.1$ who am i tmiller pts/1 Dec 10 15:27 (10.5.56.147) -bash-3.1$ sudo who am i tmiller pts/1 Dec 10 15:27 (10.5.56.147) -bash-3.1$ sudo su - -bash-3.1# who am i tmiller pts/1 Dec 10 15:27 (10.5.56.147) The who command uses the contents of the utmp (and/or utmpx) file to determine the actual user. Depending on how sudo is configured, it may allocate a new pty to run the command in, for which there will be no corresponding utmp entry. In this case, the who command will lookup the user based on the effect uid, which will be the invoking user. For instance, if the log_input, log_output or use_pty options are specified in sudoers, sudo will run the command in a new pty. Do you have any of those configured in sudoers? Here's what I get when log_output is defined: -bash-3.1$ who am i tmiller pts/1 Dec 10 15:27 (10.5.56.147) -bash-3.1$ sudo who am i root pts/2 There are no details other than the user and tty name since there is no corresponding utmp entry (as this is not a real login). ok, I do have log_input and log_output defined. Is there a way to get sudo who am i to report "properly" with these settings defined? I *love* the log_input/output feature, but using them is messing up some other stuff because of the sudo who am i output. Reopening as an enhancement to add utmp/wtmp support when a new pty is allocated. Sudo 1.7.6 and 1.8.1 will include support for updating the utmp file which will allow "who am i" to work as you expect it to. Beta versions of each are now available, see http://www.sudo.ws/sudo/devel.html Sudo 1.7.6 and 1.8.1 have support for writing to the utmp file. |