Bug 706 - Regression: 1.8.14p2 breaks sudo without tty
Regression: 1.8.14p2 breaks sudo without tty
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.14
PC Linux
: low high
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-21 14:45 MDT by Ismo Toijala
Modified: 2020-12-04 11:23 MST (History)
4 users (show)

See Also:


Attachments
Fix errno value when no tty is present (2.99 KB, patch)
2015-07-21 15:18 MDT, Todd C. Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.