@Dorin
> Perhaps sudo should try to use the name from /etc/hostname when gethostbyname 
> fails?
> It looks quite simple to do that, and assume that you'll have there 127:0.0.1 
> (in both IPv4 and v6)?!?!?!

You seem to be confused.

That's _exactly_ what `sudo` is doing: it's using the known _local_ hostname 
which would've been set in "/etc/hostname."
It has to resolve this _local_ hostname and does so with the _local_ 
"/etc/hosts" file.

> gnome-terminal is simply broken if it needs to resolve any kind of
hostname during startup.

you are aware that the X Window System is a client-server setup over the 
loopback interface aren't you?!?
Apps should _always_ be able to resolve the _local_ hostname and some have come 
to rely on this fact.

@everyone
*_There is no bug here_*
The original "bug reporter" in the _blog_ overwrote his "/etc/hosts" file and 
in doing so broke his _local_ host configuration.
`sudo` errors were merely the first symptom he noticed of his newly broken 
system.

*_To prove that something is wrong with sudo_*
you would need to show a situation where `sudo` does _not_ work but the 
following does:

~$ grep `hostname` /etc/hosts

***Revised Proof: Same machine, 2 terminals; root breaks and fixes the
system; asmoore tests sudo:

-----
[EMAIL PROTECTED]:~$ grep `hostname` /etc/hosts
127.0.1.1 pickles
[EMAIL PROTECTED]:~$ sudo id
[sudo] password for asmoore: 
uid=0(root) gid=0(root) groups=0(root)
[EMAIL PROTECTED]:~$ sudo -k

[EMAIL PROTECTED]:~# sed -i "s/pickles/foobar/g" /etc/hosts

[EMAIL PROTECTED]:~$ grep `hostname` /etc/hosts
[EMAIL PROTECTED]:~$ sudo id
sudo: unable to resolve host pickles
[EMAIL PROTECTED]:~$ sudo -k
sudo: unable to resolve host pickles

[EMAIL PROTECTED]:~# hostname foobar

[EMAIL PROTECTED]:~$ grep `hostname` /etc/hosts
127.0.1.1 foobar
[EMAIL PROTECTED]:~$ sudo id
[sudo] password for asmoore: 
uid=0(root) gid=0(root) groups=0(root)
[EMAIL PROTECTED]:~$ sudo -k

[EMAIL PROTECTED]:~# hostname `cat /etc/hostname`
[EMAIL PROTECTED]:~# sed -i "s/foobar/pickles/g" /etc/hosts

[EMAIL PROTECTED]:~$ grep `hostname` /etc/hosts
127.0.1.1 pickles
[EMAIL PROTECTED]:~$ sudo id
[sudo] password for asmoore: 
uid=0(root) gid=0(root) groups=0(root)
[EMAIL PROTECTED]:~$ sudo -k
-----

Adam sM

-- 
sudo shouldn’t ABSOLUTELY NEED to look up the host it’s running on
https://bugs.launchpad.net/bugs/32906
You received this bug notification because you are a member of Ubuntu
Bugs, which is a direct subscriber.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to