Subject: misc/25561: rc.d/network fix
To: None <gnats-bugs@gnats.netbsd.org>
From: None <carton@Ivy.NET>
List: netbsd-bugs
Date: 05/14/2004 01:16:58
>Number:         25561
>Category:       misc
>Synopsis:       escaping conventions in /etc/ifconfig.xx0 files are counterintuitive
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 14 05:18:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Miles Nordin
>Release:        NetBSD 1.6ZG current-20031212
>Organization:
Le fascisme est la dictature ouverte de la bourgeoisie.
		-- Georg Dimitrov
>Environment:
System: NetBSD castrovalva 1.6ZG NetBSD 1.6ZG (CASTROVALVA-$Revision: 1.3 $) #0: Wed Mar 31 17:14:05 EST 2004 carton@castrovalva:/scratch/src/sys/arch/alpha/compile/CASTROVALVA alpha
Architecture: alpha
Machine: alpha
src/etc/rc.d/network revision 1.44
>Description:
/etc/rc.d/network reads ifconfig.xx0 files with the shell 'read' builtin, 
which parses a bunch of escape characters and makes quoted parameters in 
the ifconfig.xx0 files not work.  changing to 'read -r' instead of 'read' 
makes it act fairly normal.
>How-To-Repeat:
put something like this in ifconfig.wi0
chan 1 nwid "Ivy Ministries" mediaopt hostap up
>Fix:
Index: network
===================================================================
RCS file: /scratch/cvsroot/netbsd/src/etc/rc.d/network,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 network
--- network	12 Dec 2003 11:13:37 -0000	1.1.1.5
+++ network	10 Mar 2004 19:27:16 -0000
@@ -197,7 +197,7 @@
 				ifconfig $int $args
 			elif [ -f /etc/ifconfig.$int ]; then
 				echo -n " $int"
-				while read args; do
+				while read -r args; do
 					[ -z "$args" ] && continue
 					case "$args" in
 					"#"*|create)
>Release-Note:
>Audit-Trail:
>Unformatted: