Bug 654 - sudoedit doesn't work at all in AIX since at least sudo.1.8.9.4
sudoedit doesn't work at all in AIX since at least sudo.1.8.9.4
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.10
PC AIX
: low normal
Assigned To: Todd C. Miller
: 659 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-25 04:11 MDT by Davide
Modified: 2014-09-24 09:32 MDT (History)
1 user (show)

See Also:


Attachments
Avoid using /proc on AIX to determine program name (456 bytes, patch)
2014-07-25 10:12 MDT, Todd C. Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Davide 2014-07-25 04:11:43 MDT
sudoedit stopped working in AIX. It doesn't matter AIX version (tried in 5.2, 5.3, 6.1, 7).
Last tried sudo version which works is 1.8.8.0.
First tried version which doesn't work is 1.8.9.4.

This is what sudoedit answers in a recent version:
root@HOST:/> sudoedit
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...

This is what says in a working machine
root@HOST:/> sudoedit
usage: sudoedit [-AknS] [-C fd] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] file ...

If you try to edit a file:
root@HOST:/> sudoedit /etc/motd
sudo: /etc/motd: command not found
root@HOST:/>

Editor is never opened.

sudo -e seems to work, but sometimes it gives you an error when exiting:

"/var/tmp/motd.ocSWRGw3" 37 lines, 1689 characters 
sudo: unable to execute /bin/vi: Interrupted system call

This makes new sudo versions useless in our installation. We forbid users to use vi and the alternative is sudoedit.
Comment 1 Todd C. Miller 2014-07-25 08:12:14 MDT
Confirmed on AIX 5.3, it looks like the it is not properly matching on the program name,  However, I also see a hang with "sudo -e filename" which will also need to be fixed.
Comment 2 Todd C. Miller 2014-07-25 10:12:21 MDT
Created attachment 415 [details]
Avoid using /proc on AIX to determine program name

The problem is that on AIX when you get the executable name via /proc and you executed a symbolic link, it gives you the link target and not the name of the link itself.
Comment 3 Todd C. Miller 2014-07-25 14:51:37 MDT
The hang I was seeing is only when debugging is enabled via sudo.conf so it should affect you.  The attached patch should be sufficiet.  As a workaround you can just use "sudo -e" instead of sudoedit.
Comment 4 Todd C. Miller 2014-07-28 10:47:23 MDT
This will be fixed in sudo 1.8.11.  For the time being, if you replace the sudoedit symbolic link with a hard link it will work as expected.
Comment 5 Todd C. Miller 2014-09-02 07:04:53 MDT
*** Bug 659 has been marked as a duplicate of this bug. ***
Comment 6 Todd C. Miller 2014-09-24 09:32:32 MDT
Fixed in sudo 1.8.11.