Comment 45 for bug 32906

Revision history for this message
agent 8131 (agent-8131) wrote : Re: sudo shouldn’t ABSOLUTELY NEED to look up the host it’s running on

Please refrain from discouraging people to contribute. People are trying to help by sharing their experiences in hopes that the additional information will be useful to resolving this bug.

Furthermore, Martin Pitt has also stated that he does not consider this to be a bug and that does require discussion from those of us who feel that it is a bug. He also mentions (in his first post) that not having an entry for the local machine hostname in /etc/hosts will cause trouble. This is incorrect and needs to be pointed out. The only program that seems to have trouble without such an entry is sudo which is one reason why I think this should be fixed in sudo.

However, this is also a bug with multiple potential solutions. These should be considered in deciding an optimal solution.

Finally, if anyone does not want to receive mail about this bug by all means unsubscribe yourself.

Now, I wanted to address Martin Pitt's concern about reproducing this bug. I wonder if factors such as having a dns caching server might be related to this not being reproducible. However, here are my results from a virtual machine (with no copy and paste so bear with me) running up to date Ubuntu 8.04.

/etc/hosts contains:
127.0.1.1 hardy64server

/etc/sudoers is the default:
Defaults env_reset
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL

$ sudo id
[sudo] password for agent:
uid=0(root) gid=0(root) groups=0(root)

$ sudo nano /etc/hosts
comment out hostname line

$ sudo -k
sudo: unable to resolve host hardy64server

$ sudo id
sudo: unable to resolve host hardy64server

$ su
$ nano /etc/hosts
restore hostname line
$ exit

$ sudo id
[sudo] password for agent:
uid=0(root) gid=0(root) groups=0(root)