summaryrefslogtreecommitdiff
path: root/usr.sbin/rcctl
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-29 21:04:38 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-29 21:04:38 +0000
commitcf12f51d2b5f10f150d699c2b913d639f0773a0b (patch)
tree75935311a4e64a05aaf7f777741461bdb5cc135c /usr.sbin/rcctl
parent5d4fb18fcc25e9ddb7157b4c113281e336b5b62a (diff)
Additional input validation:
Error out on "rcctl enable daemon flags NO". Without this check, this "enable" command effectively disabled the daemon. "commit" ajacoutot@
Diffstat (limited to 'usr.sbin/rcctl')
-rw-r--r--usr.sbin/rcctl/rcctl.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index ba4c7ee658f..76bb1613c91 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.33 2014/08/29 20:21:13 schwarze Exp $
+# $OpenBSD: rcctl.sh,v 1.34 2014/08/29 21:04:37 schwarze Exp $
#
# Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -281,6 +281,9 @@ if [ -n "$flag" ]; then
if svc_is_special $svc; then
_rc_err "${0##*/}: \"$svc\" is a special variable, cannot set \"flags\""
fi
+ if [ "$4" = "NO" ]; then
+ _rc_err "${0##*/}: \"flags NO\" contradicts \"enable\""
+ fi
else
usage
fi