[Buildroot] [git commit] busybox: udhcpc.script: fix resolv.conf handling with multiple interfaces

Peter Korsgaard jacmet at sunsite.dk
Wed Jun 26 19:51:18 UTC 2013


>>>>> "Arnout" == Arnout Vandecappelle <arnout at mind.be> writes:

 >> diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
 >> index f7beb56..43742fb 100755
 >> --- a/package/busybox/udhcpc.script
 >> +++ b/package/busybox/udhcpc.script
 >> @@ -13,6 +13,13 @@ case "$1" in
 >> /sbin/ifconfig $interface up
 >> /sbin/ifconfig $interface 0.0.0.0
 >> 
 >> +		# drop info from this interface
 >> +		# resolv.conf may be a symlink to /tmp/, so take care
 >> +		TMPFILE=$(mktemp)
 >> +		grep -vE "# $interface\$" $RESOLV_CONF > $TMPFILE
 >> +		cat $TMPFILE > $RESOLV_CONF

 Arnout>  Isn't the non-atomicity of this line a potential race condition?

Possibly, but no worse than what it was before ;)


 Arnout> mv -f $TMPFILE $(readlink -f $RESOLV_CONF)
 Arnout> might be a better idea.

Yes. Care to send a patch?

-- 
Bye, Peter Korsgaard


More information about the buildroot mailing list