diff options
author | 2015-01-12 14:40:35 +0000 | |
---|---|---|
committer | 2015-01-12 14:40:35 +0000 | |
commit | cb15d449de3c979e4dfee7b8eaa3f4b99b15a759 (patch) | |
tree | 4a2df7b0993c3269dece8d74993aa112236bb6f3 | |
parent | Use proper casts for ctype functions. This is already fixed in nsd (diff) | |
download | wireguard-openbsd-cb15d449de3c979e4dfee7b8eaa3f4b99b15a759.tar.xz wireguard-openbsd-cb15d449de3c979e4dfee7b8eaa3f4b99b15a759.zip |
Make sure the given user exists.
"I like it" sthen@
ok robert@
-rw-r--r-- | usr.sbin/rcctl/rcctl.sh | 6 |
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 |