summaryrefslogtreecommitdiff
path: root/sbin/devpubd
diff options
context:
space:
mode:
authorkre <kre@NetBSD.org>2021-08-05 12:45:33 +0000
committerkre <kre@NetBSD.org>2021-08-05 12:45:33 +0000
commit7abe0480cb58f8fba294c97f74c5e89af80525c7 (patch)
tree0617bc4c499cf0e53526424e5ae8f45c5829b24c /sbin/devpubd
parent6c60cdeb2ed247224087ff4d6ab54cea6e1ad4b3 (diff)
Expunge bogus (implementation defined / unspecified) uses of $@ in
scripts. $@ is unspecified except when used in a place where field splitting can occur (which is never in an assignment), X=$@ (with or without double quotes) is simply wrong. Use $* instead of $@ in such places, or as here, simply change the way things are done (very very slightly) and DTRT.
Diffstat (limited to 'sbin/devpubd')
-rwxr-xr-xsbin/devpubd/devpubd-run-hooks.in6
-rwxr-xr-xsbin/devpubd/hooks/01-makedev5
2 files changed, 5 insertions, 6 deletions
diff --git a/sbin/devpubd/devpubd-run-hooks.in b/sbin/devpubd/devpubd-run-hooks.in
index cfac7fa5ea4..4b88d576780 100755
--- a/sbin/devpubd/devpubd-run-hooks.in
+++ b/sbin/devpubd/devpubd-run-hooks.in
@@ -1,19 +1,19 @@
#!/bin/sh
#
-# $NetBSD: devpubd-run-hooks.in,v 1.3 2015/02/15 15:56:30 jmcneill Exp $
+# $NetBSD: devpubd-run-hooks.in,v 1.4 2021/08/05 12:45:33 kre Exp $
#
# devpubd run hooks
devpubd_event=$1
shift
-devpubd_devices=$@
+
devpubd_hooks_base=@HOOKSDIR@
case $devpubd_event in
device-attach|device-detach)
for hook in ${devpubd_hooks_base}/*; do
if [ -x "${hook}" ]; then
- "${hook}" ${devpubd_event} ${devpubd_devices}
+ "${hook}" ${devpubd_event} "$@"
fi
done
;;
diff --git a/sbin/devpubd/hooks/01-makedev b/sbin/devpubd/hooks/01-makedev
index 10f49116a95..68d0914031f 100755
--- a/sbin/devpubd/hooks/01-makedev
+++ b/sbin/devpubd/hooks/01-makedev
@@ -1,16 +1,15 @@
#!/bin/sh
#
-# $NetBSD: 01-makedev,v 1.2 2015/02/15 15:56:30 jmcneill Exp $
+# $NetBSD: 01-makedev,v 1.3 2021/08/05 12:45:33 kre Exp $
#
# Try to create a device node if it doesn't exist
#
event="$1"
shift
-devices=$@
case $event in
device-attach)
- cd /dev && sh MAKEDEV -u $devices 2>/dev/null
+ cd /dev && sh MAKEDEV -u "$@" 2>/dev/null
;;
esac