naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0073-ifcfg-Quote-left-hand-side-of-expression.patch

99be8f
From 955ce06f1f4be5a8733e5829e3c8cadf9fc68c40 Mon Sep 17 00:00:00 2001
99be8f
From: Andrea Claudi <aclaudi@redhat.com>
99be8f
Date: Mon, 29 Apr 2019 20:05:37 +0200
99be8f
Subject: [PATCH] ifcfg: Quote left-hand side of [ ] expression
99be8f
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
99be8f
Upstream Status: iproute2.git commit 1e3197e0fdbf2
99be8f
99be8f
commit 1e3197e0fdbf299fe24cdba7c0d613317ed82063
99be8f
Author: Phil Sutter <phil@nwl.cc>
99be8f
Date:   Thu Aug 17 19:09:32 2017 +0200
99be8f
99be8f
    ifcfg: Quote left-hand side of [ ] expression
99be8f
99be8f
    This prevents word-splitting and therefore leads to more accurate error
99be8f
    message in case 'grep -c' prints something other than a number.
99be8f
99be8f
    Signed-off-by: Phil Sutter <phil@nwl.cc>
99be8f
---
99be8f
 ip/ifcfg | 2 +-
99be8f
 1 file changed, 1 insertion(+), 1 deletion(-)
99be8f
99be8f
diff --git a/ip/ifcfg b/ip/ifcfg
99be8f
index 083d9df36742f..30a2dc49816cd 100644
99be8f
--- a/ip/ifcfg
99be8f
+++ b/ip/ifcfg
99be8f
@@ -131,7 +131,7 @@ noarp=$?
99be8f
 
99be8f
 ip route add unreachable 224.0.0.0/24 >& /dev/null
99be8f
 ip route add unreachable 255.255.255.255 >& /dev/null
99be8f
-if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
99be8f
+if [ "`ip link ls $dev | grep -c MULTICAST`" -ge 1 ]; then
99be8f
   ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
99be8f
 fi
99be8f
 
99be8f
-- 
99be8f
2.20.1
99be8f