Bug 706

Summary: Regression: 1.8.14p2 breaks sudo without tty
Product: Sudo Reporter: Ismo Toijala <ismo.toijala>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: high CC: deepak.h.nair, garga, ismo.toijala, Rdav3085
Priority: low    
Version: 1.8.14   
Hardware: PC   
OS: Linux   
Attachments: Fix errno value when no tty is present

Description Ismo Toijala 2015-07-21 14:45:23 MDT
Changeset 10145:c58cce92d5e0 breaks sudo without a tty.

To reproduce:
Run `sudo foo` without a tty.
For me this means running sudo through dmenu or an i3 keybinding.

Result:
'sudo: main: unable to allocate memory' in the journal (output to stderr I guess).
`foo` is not run.
Comment 1 Todd C. Miller 2015-07-21 15:18:01 MDT
Created attachment 454 [details]
Fix errno value when no tty is present

Please try the attached patch.
Comment 2 Ismo Toijala 2015-07-22 01:28:15 MDT
It works with the patch.
Thanks.

I think line 457 (after patching) should be `goto`, not `got`.
Comment 3 Todd C. Miller 2015-07-22 07:09:13 MDT
Fixed in 1.8.14p3
Comment 4 Deepak 2015-10-19 03:15:14 MDT
Hi!

I deployed 1.8.14p3 in nearly 100 AIX systems. One of them still have this problem! Sudo breaks  with ssh without -t. Other systems on same OS levels work without issues!

localid@localhost:/home/localid$ /bin/ssh -t -l remoteid remotehost sudo -V
Sudo version 1.8.14p3
Sudoers policy plugin version 1.8.14p3
Sudoers file grammar version 44
Sudoers I/O plugin version 1.8.14p3
Connection to remotehost closed.
localid@localhost:/home/localid$ /bin/ssh -l remoteid remotehost sudo -V
sudo: main: unable to allocate memory
localid@localhost:/home/localid$ /bin/ssh -l remoteid remotehost 'uname -s && oslevel -s'        
AIX
5300-12-05-1140
localid@localhost:/home/localid$
Comment 5 Todd C. Miller 2020-12-04 11:23:06 MST
Sudo no longer treats an inability to determine the tty as a fatal error so I think this can be closed.