]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc/checkconfig: avoid subshell (SC2235)
authorSimon Deziel <simon.deziel@canonical.com>
Fri, 6 Oct 2023 04:31:27 +0000 (00:31 -0400)
committerSimon Deziel <simon.deziel@canonical.com>
Fri, 6 Oct 2023 05:43:17 +0000 (01:43 -0400)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
src/lxc/cmd/lxc-checkconfig.in

index e60f27bf9e3702eabe0015e0c594fb944bd03bf5..323364240f199e9333360fa27f2a7b7564a95002 100755 (executable)
@@ -156,7 +156,7 @@ if is_set CONFIG_USER_NS; then
 fi
 echo -n "Network namespace: " && is_enabled CONFIG_NET_NS
 echo
-if [ $KVER_MAJOR -lt 4 ] || ([ $KVER_MAJOR -eq 4 ] && [ $KVER_MINOR -lt 7 ]); then
+if [ $KVER_MAJOR -lt 4 ] || { [ $KVER_MAJOR -eq 4 ] && [ $KVER_MINOR -lt 7 ]; }; then
     echo -n "Multiple /dev/pts instances: " && is_enabled DEVPTS_MULTIPLE_INSTANCES
     echo
 fi
@@ -215,7 +215,7 @@ echo -n "Cgroup cpu account: " && is_enabled CONFIG_CGROUP_CPUACCT
 echo
 
 echo -n "Cgroup memory controller: "
-if ([ $KVER_MAJOR -ge 3 ] && [ $KVER_MINOR -ge 6 ]) || [ $KVER_MAJOR -gt 3 ]; then
+if { [ $KVER_MAJOR -ge 3 ] && [ $KVER_MINOR -ge 6 ]; } || [ $KVER_MAJOR -gt 3 ]; then
     is_enabled CONFIG_MEMCG
 else
     is_enabled CONFIG_CGROUP_MEM_RES_CTLR
@@ -235,7 +235,7 @@ echo
 echo -n "Bridges: " && is_enabled CONFIG_BRIDGE && is_probed bridge
 echo
 echo -n "Advanced netfilter: " && is_enabled CONFIG_NETFILTER_ADVANCED && is_probed nf_tables
-if ( [ $KVER_MAJOR -gt 3 ] && [ $KVER_MINOR -gt 6 ] ) && [ $KVER_MAJOR -lt 5 ] ; then
+if { [ $KVER_MAJOR -gt 3 ] && [ $KVER_MINOR -gt 6 ]; } && [ $KVER_MAJOR -lt 5 ]; then
     echo
     echo -n "CONFIG_NF_NAT_IPV4: " && is_enabled CONFIG_NF_NAT_IPV4 && is_probed nf_nat_ipv4
     echo