Comment 13 for bug 32906

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

I tried to reproduce this. I opened two terminal windows, and did "sudo -i" in one of them to get a root shell (#), the other is a normal user shell ($)

$ sudo id
[sudo] password for martin:
uid=0(root) gid=0(root) Gruppen=0(root)
0 martin@donald:~
$ sudo -k

so by default, sudo works. Now let's mangle the hostname:

# hostname foobar

On Dapper I now get:

$ sudo id
sudo: unable to lookup foobar via gethostbyname()

while on current Hardy I get:

$ sudo id
sudo: unable to resolve host foobar
[sudo] password for martin:
uid=0(root) gid=0(root) Gruppen=0(root)

i. e. it still warns me, but doesn't fail any more. Now, when I reset the hostname with

  # hostname `cat /etc/hostname`

everything works again on both dapper and hardy.

So this seems to be fixed for me. However, some of the recent duplicates (like bug 197494) seem to indicate that it is still a problem in hardy.

I sanyone actually able to reproduce this? Can you please post a recipe here?

For the record, I'm using the default sudoers:

$ sudo grep -v '^#' /etc/sudoers | grep -v '^$'
Defaults env_reset
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL

Or, asked the other way round, can you please check if it is fixed for you as well on current Hardy?

Thanks in advance to all!