[Midnightbsd-cvs] src [12271] stable/1.1/etc/rc.d/mdnsd: fix a write bug with updating nsswitch.conf

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Oct 18 12:13:38 EDT 2019


Revision: 12271
          http://svnweb.midnightbsd.org/src/?rev=12271
Author:   laffer1
Date:     2019-10-18 12:13:38 -0400 (Fri, 18 Oct 2019)
Log Message:
-----------
fix a write bug with updating nsswitch.conf

Modified Paths:
--------------
    stable/1.1/etc/rc.d/mdnsd

Modified: stable/1.1/etc/rc.d/mdnsd
===================================================================
--- stable/1.1/etc/rc.d/mdnsd	2019-10-17 23:05:57 UTC (rev 12270)
+++ stable/1.1/etc/rc.d/mdnsd	2019-10-18 16:13:38 UTC (rev 12271)
@@ -19,11 +19,11 @@
 	if grep -q mdns "/etc/nsswitch.conf"; then
 		return
 	else
-		if [ ! -w /etc/nswitch.conf ]; then
+		if [ -w /etc/nswitch.conf ]; then
 			echo ' /etc/nswitch.conf is not writable, update failed.'
 			return
 		fi
-		sed 's|^\(hosts.*\)files dns|\1files mdns dns|g' /etc/nsswitch.conf
+		sed -i.bak  -e 's|^\(hosts.*\)files dns|\1files mdns dns|g' /etc/nsswitch.conf
 	fi
 }
 



More information about the Midnightbsd-cvs mailing list