File: 20quoting.patch

package info (click to toggle)
netplug 1.2.9.2-3.1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 316 kB
  • sloc: ansic: 1,207; sh: 136; makefile: 51
file content (29 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Properly quote interface names.
--- netplug-1.2.9.1.orig/scripts/netplug
+++ netplug-1.2.9.1/scripts/netplug
@@ -25,7 +25,7 @@
 case "$action" in
 in)
     if [ -x /sbin/ifup ]; then
-	exec /sbin/ifup $dev
+	exec /sbin/ifup "$dev"
     else
 	echo "Please teach me how to plug in an interface!" 1>&2
 	exit 1
@@ -35,14 +35,14 @@
     if [ -x /sbin/ifdown ]; then
 	# At least on Fedora Core 1, the call to ip addr flush infloops
 	# /sbin/ifdown $dev && exec /sbin/ip addr flush $dev
-	exec /sbin/ifdown $dev
+	exec /sbin/ifdown "$dev"
     else
 	echo "Please teach me how to unplug an interface!" 1>&2
 	exit 1
     fi
     ;;
 probe)
-    exec /sbin/ip link set $dev up >/dev/null 2>&1
+    exec /sbin/ip link set "$dev" up >/dev/null 2>&1
     ;;
 *)
     echo "I have been called with a funny action of '%s'!" 1>&2