Bug 1030

Summary: environment problem when log_subcmds is enabled
Product: Sudo Reporter: bob.schwartz
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.9.10   
Hardware: IBM   
OS: AIX   

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.