summaryrefslogtreecommitdiff
path: root/usr.sbin/syspatch/syspatch.sh
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2016-11-25 09:56:46 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2016-11-25 09:56:46 +0000
commitfbfc9e3b7cf5434d9c7023d8e18b7ac54f2470ad (patch)
tree22206c5a7d0eeda58ead3797d778bca3193a2743 /usr.sbin/syspatch/syspatch.sh
parentf0c7ed10b7576c5b0935bae2a7001a00298bc5bf (diff)
Check args.
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r--usr.sbin/syspatch/syspatch.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index adcaea37545..93c04041bc3 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.60 2016/11/22 14:20:39 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.61 2016/11/25 09:56:45 ajacoutot Exp $
#
# Copyright (c) 2016 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -311,8 +311,8 @@ set -A _KERNV -- $(sysctl -n kern.version |
sed 's/^OpenBSD \([0-9]\.[0-9]\)\([^ ]*\).*/\1 \2/;q')
[[ -z ${_KERNV[1]} ]]
-[[ $@ == @(|-c|-r) ]] && [[ $(id -u) -ne 0 ]] && \
- sp_err "${0##*/}: need root privileges"
+[[ $@ == @(|-[[:alpha:]]) ]] || usage; [[ $@ == @(|-(c|r)) ]] &&
+ [[ $(id -u) -ne 0 ]] && sp_err "${0##*/}: need root privileges"
# XXX to be discussed; check for $ARCH?
[[ -d ${PATCH_PATH} ]] && PATCH_PATH="file://$(readlink -f ${PATCH_PATH})"