Bug 1030 - environment problem when log_subcmds is enabled
environment problem when log_subcmds is enabled
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.9.10
IBM AIX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-05-25 10:51 MDT by bob.schwartz
Modified: 2022-06-06 13:10 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bob.schwartz 2022-05-25 10:51:52 MDT
On AIX, if log_subcmds is enabled, becoming another user does not get proper environment.  For example, the following sequence:

sudo -i
su - otheruser
vi testfile

This will throw an error - "History file has no read permission"

Output from truss shows vi attempting to read //.vi_history instead of .vi_history from the user.

This can also be seen via output from the "env" command.  Root's path is still in place instead of otherusers.  

Behavior works as expected if log_subcmds is not enabled.
Comment 1 Todd C. Miller 2022-05-25 17:04:49 MDT
I can't reproduce that behavior on other platforms, I will try on AIX soon.
Comment 2 Todd C. Miller 2022-05-26 16:34:50 MDT
I was able to reproduce the issue on AIX.  It is fixed by the following commit, which will be part of sudo 1.9.11.

https://www.sudo.ws/repos/sudo/rev/dc0187c68c1b
Comment 3 Todd C. Miller 2022-06-06 13:10:03 MDT
Fixed in sudo 1.9.11, which is available now.