summaryrefslogtreecommitdiff
path: root/usr.sbin/rcctl/rcctl.sh
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2015-01-12 14:40:36 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2015-01-12 14:40:36 +0000
commit60e79ba7089a9f84ea2477775f4ffeb579306868 (patch)
tree9e377d8e396b4181e110663cd6bf70b08289501c /usr.sbin/rcctl/rcctl.sh
parent365a8f88070a1c17291ace5b367777e786409ebd (diff)
Make sure the given user exists.
"I like it" sthen@ ok robert@
Diffstat (limited to 'usr.sbin/rcctl/rcctl.sh')
-rw-r--r--usr.sbin/rcctl/rcctl.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh
index 93b20b9ddc1..b1f8de88bdc 100644
--- a/usr.sbin/rcctl/rcctl.sh
+++ b/usr.sbin/rcctl/rcctl.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.62 2015/01/12 13:51:20 ajacoutot Exp $
+# $OpenBSD: rcctl.sh,v 1.63 2015/01/12 14:40:35 ajacoutot Exp $
#
# Copyright (c) 2014, 2015 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -308,6 +308,10 @@ svc_set()
[[ ${_args} != +([[:digit:]]) || ${_args} -le 0 ]] && \
_rc_err "${0##*/}: \"${_args}\" is not a positive integer"
fi
+ if [ "${_var}" = "user" ]; then
+ getent passwd "${_args}" >/dev/null || \
+ _rc_err "${0##*/}: user \"${_args}\" does not exist"
+ fi
# unset flags if they match the default enabled ones
[ "${_args}" = "$(svc_getdef ${_svc} ${_var})" ] && \
unset _args