Bugzilla – Bug 552
sudo 1.8.4 hangs on AIX 6.1 if no TTY is available
Last modified: 2012-05-24 10:37:27 MDT
On AIX 6.1, sudo 1.8.4 will always hang (even just 'sudo -V' or 'sudo -h' hangs) if it is run without a TTY (for example, if it is run from a cron job or from a script executed using 'ssh -T ...'). This seems to be caused by the following change: http://www.sudo.ws/repos/sudo/rev/b9dfce12af85 Here is a stack trace from a hung sudo process: #0 0xd013087c in open () from /usr/lib/libc.a(shr.o) #1 0xd013019c in open64 () from /usr/lib/libc.a(shr.o) #2 0x1000b430 in get_process_ttyname () at ./ttyname.c:168 #3 0x1000952c in get_user_info.constprop.11 () at ./sudo.c:469 #4 0x10000578 in main (argc=2, argv=<incomplete type>, envp=<incomplete type>) at _start_ :198 It looks like calling open() on /proc/<parent PID>/fd/1 under AIX simply hangs forever.
Created attachment 339 [details] Patch to open /proc/ppid/fd/[0-2] in non-blocking mode I'm unable to reproduce this behavior on AIX 6.1 but opening the file in non-blocking mode should help. Please try the attached patch. If that doesn't help I have a test program I'll ask you to run under truss.
Can you try the current beta version of sudo 1.8.5? I've rewritten the tty fallback code for systems with an SVR4-style /proc (like AIX). See http://www.sudo.ws/devel.html
Sorry for the delay in responding. I just tried 1.8.5rc1, and everything seems to work fine. I have not tried the non-blocking patch ... it looks like you've replaced all that code now anyway. Thank you very much!
*** Bug 557 has been marked as a duplicate of this bug. ***