Bug#360066: sudo fails to lookup hostname if it contains a hyphen (-)

2007-10-14 Thread Anthony Towns
tag 360066 unreproducible
thanks

I think this is actually due to a typo on the submitter's behalf:

 [EMAIL PROTECTED]:~$ sudo ps
 sudo: unable to lookup az-svr-01 via gethostbyname()
   PID TTY  TIME CMD
 12302 pts/000:00:00 ps

 If I change the hostname to azsrv01 sudo is silent about this:
 [EMAIL PROTECTED]:~$ sudo ps

Note that az-svr-01, azsrv01 and azsvr01 appear with variants of
svr and srv. If I try that myself, setting my hostname to az-svr-01
as indicated in the first prompt, and adding fqdn to the Defaults line
of my /etc/sudoers, I get the following results:

] # grep az- /etc/hosts
] 127.0.2.2   az-srv-01
] # sudo echo hi
] sudo: unable to lookup az-svr-01 via gethostbyname()
] hi

] # vi /etc/hosts
] # grep az- /etc/hosts
] 127.0.2.2   az-svr-01
] # sudo echo hi
] hi

Unless there's some other circumstances that make the submitter's machine
behave differently, I think this bug report can be closed.

HTH.

Cheers,
aj


signature.asc
Description: Digital signature


Bug#360066: sudo fails to lookup hostname if it contains a hyphen (-)

2006-03-30 Thread Martin van Es
Package: sudo
Version: 1.6.8p12-1
Severity: important

sudo complains about not being able to lookup the hostname via
gethostbyname if the hostname contains one or more hyphens as
demonstrated below:

[EMAIL PROTECTED]:~$ sudo ps
sudo: unable to lookup az-svr-01 via gethostbyname()
  PID TTY  TIME CMD
12302 pts/000:00:00 ps

If I change the hostname to azsrv01 sudo is silent about this:
[EMAIL PROTECTED]:~$ sudo ps
  PID TTY  TIME CMD
12320 pts/000:00:00 ps

In both cases I have the hostname in /etc/hosts pointing to 127.0.0.1
Other programs using gethostbyname() like ping never complain.

In case of a broken hostname lookup the error doesn't cause much harm, except 
in the case of sudo su. This
results in very strange and broken behaviour in the resulting root shell 
(bash). Which is, in my opinion, a grave bug.

Regards,
Martin


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages sudo depends on:
ii  libc6 2.3.6-3GNU C Library: Shared libraries an
ii  libpam-modules0.79-3.1   Pluggable Authentication Modules f
ii  libpam0g  0.79-3.1   Pluggable Authentication Modules l

sudo recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]