NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48379: resolv.conf symlink changes not picked up by resolver



>Number:         48379
>Category:       bin
>Synopsis:       resolv.conf symlink changes not picked up by resolver
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 13 17:30:00 +0000 2013
>Originator:     David Brownlee
>Release:        NetBSD-6.1
>Organization:
>Environment:
NetBSD forsaken.absd.org 6.1_STABLE NetBSD 6.1_STABLE (GENERIC) #0: Thu Oct 24 
13:50:23 BST 2013  
abs%cerberus.social-events.net@localhost:/var/obj/nbbuild-6-amd64/objdir/sys/arch/amd64/compile/GENERIC
 amd64

>Description:
The system automatically detects changes to /etc/resolv.conf and reloads as 
required.

This works fine if /etc/resolv.conf is a file and changes, or if 
/etc/resolv.conf is a symlink and the contents of the file linked to changes, 
but fails if /etc/resolv.conf is a symlink to one file and changes to a symlink 
to another file.


>How-To-Repeat:
Assuming working nameserver at 192.168.1.1 and no nameserver at 192.168.99.99

cd /etc
echo 'nameserver 192.168.99.99' > resolv.1
ln -sf resolv.1 resolv.conf
[start app such as firefox, enter url with hostname, confirm it fails]
echo 'nameserver 192.168.1.1' > resolv.2
ln -sf resolv.2 resolv.conf
[try URL in firefox - it should now work, but fails]
touch resolv.1
[try URL in firefox - it now works, presumably as the system is checking for 
updates to resolv.1]



>Fix:
The system would need to handle the case of symlink specifically, and reload if 
readlink() changes, or the timestamp of the (final) linked to file changes.



Home | Main Index | Thread Index | Old Index