Bug 122479

Summary: ipcalc failes to find hosnames for addresses
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 7.52-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-05 01:22:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2004-05-04 23:36:34 UTC
Description of problem:

I am not so sure if this the right spot to complain about but
the problem easily can be demonstrated with ipcalc.

On two installations of FC2T3, one i386 and one x86_64, both have

hosts:      files dns

in /etc/nsswitch.conf and 'order hosts,bind' in /etc/host.conf
and a line like this

192.168.23.196  dyna4.home.front dyna4

in /etc/hosts. On i386 installation one gets:

$ ipcalc -h 192.168.23.196
HOSTNAME=dyna4.home.front

but for x86_64 the same action results in

$ ipcalc -h 192.168.23.196
ipcalc: cannot find hostname for 192.168.23.196: Unknown host

and similar for any other entry listed in /etc/hosts.

Checking with 'strace -e open ...' on i386 one can observe:

# strace -e open ipcalc -h 192.168.23.196
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
open("/etc/popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
open("/root/.popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
open("/etc/nsswitch.conf", O_RDONLY)    = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libnss_files.so.2", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY)      = 3
open("/etc/host.conf", O_RDONLY)        = 3
open("/etc/hosts", O_RDONLY)            = 3
HOSTNAME=dyna4.home.front

but on x86_64 the same action results in

# strace -e open ipcalc -h 192.168.23.196
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/tls/libc.so.6", O_RDONLY)  = 3
open("/etc/popt", O_RDONLY)             = -1 ENOENT (No such file or
directory)
open("/root/.popt", O_RDONLY)           = -1 ENOENT (No such file or
directory)
open("/etc/nsswitch.conf", O_RDONLY)    = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/libnss_files.so.2", O_RDONLY) = 3
open("/etc/resolv.conf", O_RDONLY)      = 3
open("/etc/host.conf", O_RDONLY)        = 3
open("/etc/hosts", O_RDONLY)            = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/libnss_dns.so.2", O_RDONLY) = 3
open("/lib64/libresolv.so.2", O_RDONLY) = 3
ipcalc: cannot find hostname for 192.168.23.196: Unknown host

It looks like that /etc/hosts is opened but its content discarded.

As a side-effect x86_64 machines with dynamically asigned IP addresses
end up with 'localhost.localdomain' for names.

Version-Release number of selected component (if applicable):
initscripts-7.50-1

How reproducible:
Always

Comment 1 Bill Nottingham 2004-05-05 01:22:36 UTC
Fixed in 7.52-1, *grumble*.

/me goes looking for an RFC to whack someone with