From 1979c4a83f8a62aaeef5782796282d7baf97af04 Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Fri, 7 Oct 2011 07:26:50 +0000 Subject: Check if we are root right from the start. ok robert@ --- etc/rc.d/rc.subr | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index 56f82af565b..ac3c8b169f2 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.50 2011/10/07 07:17:25 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.51 2011/10/07 07:26:49 ajacoutot Exp $ # # Copyright (c) 2010, 2011 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -80,9 +80,6 @@ rc_wait() { } rc_cmd() { - [ $(id -u) -eq 0 ] || \ - rc_err "$0: need root privileges" - [ -z "${_RC_FORCE}" ] && [ X"${daemon_flags}" = X"NO" ] && exit 1 eval _enotsup=\${rc_${1}} @@ -142,6 +139,8 @@ rc_cmd() { esac } +[ $(id -u) -eq 0 ] || rc_err "$0: need root privileges" + [ -z "${local_rcconf}" ] && . /etc/rc.conf [ -n "${daemon}" ] || rc_err "$0: daemon is not set" -- cgit v1.2.3