From d856fc8dbc236cd6732a7aca9411d24891dca069 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 5 Sep 2024 06:41:53 +0200 Subject: [PATCH] board/common: shellcheck fixes to 'doas' sudo wrapper Passing $@ to sudo requires quoting to prevent splitting arguments like this: admin@R2:~$ doas vtysh -c 'show ip ospf routes' % Command incomplete: show After this patch: admin@R2:~$ doas vtysh -c 'show ip ospf route' ============ OSPF network routing table ============ N 192.168.50.0/24 [1] area: 0.0.0.0 directly attached to e7 ============ OSPF router routing table ============= R 192.168.100.1 [1] area: 0.0.0.0, ASBR via 192.168.50.1, e7 ============ OSPF external routing table =========== N E2 192.168.10.0/24 [1/20] tag: 0 via 192.168.50.1, e7 N E2 192.168.100.1/32 [1/20] tag: 0 via 192.168.50.1, e7 Signed-off-by: Joachim Wiberg --- board/common/rootfs/usr/bin/doas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/common/rootfs/usr/bin/doas b/board/common/rootfs/usr/bin/doas index ca55870a..efd49044 100755 --- a/board/common/rootfs/usr/bin/doas +++ b/board/common/rootfs/usr/bin/doas @@ -2,4 +2,4 @@ # Silly wrapper around sudo to prevent it from printing an error for # unprivileged users: sudo: a password is required -id -nG $LOGNAME | grep -qw wheel && sudo -n $@ +id -nG "$LOGNAME" | grep -qw wheel && sudo -n "$@"