Bug 859

Summary: sudo wrong error
Product: Sudo Reporter: jg
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.21   
Hardware: PC   
OS: Linux   

Description jg 2018-11-04 12:24:25 MST
Strange error. Not sure why sudo is trying to resolve host. Its an AWS machine, it is uptodate and connected to internet as I logged in over SSH.

$ sudo bash
sudo: unable to resolve host ip-172-31-17-160: Resource temporarily unavailable

# whoami
root

# exit
exit
$ sudo bash
sudo: unable to resolve host ip-172-31-17-160: Resource temporarily unavailable
# whoami
root
# exit
exit
Comment 1 jg 2018-11-04 12:27:12 MST
I imagine it is because there isn't any space to write a file somewhere.
Shouldn't be an an EAGAIN message

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G     0  7.9G   0% /dev
tmpfs           1.6G   89M  1.5G   6% /run
/dev/xvda1      7.7G  7.7G     0 100% /
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
tmpfs           1.6G     0  1.6G   0% /run/user/1000
Comment 2 Todd C. Miller 2018-11-04 14:51:32 MST
If you are on a debian-based Linux system (like Ubuntu) you may be able to avoid this with the following line in sudoers:

Defaults !fqdn

This is not enabled by default on most systems but Debian changes the default...

You are correct that the error message is wrong here.  Sudo should be reporting the string version of gai_errno, not regular errno.
Comment 3 Todd C. Miller 2018-11-06 07:25:28 MST
This is fixed by https://www.sudo.ws/repos/sudo/rev/9c37c5db3293
Comment 4 Todd C. Miller 2018-11-16 11:14:51 MST
Fixed in sudo 1.8.26.