naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

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

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