From 312bbabaac7dc92251a2100c559c28f63563e7d9 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Tue, 6 Jan 2015 14:48:59 +0000 Subject: [PATCH] Simplify special vars argument checking; invalidating some bogus constructs in the process. --- usr.sbin/rcctl/rcctl.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index 62f941b1caa..9b83a5924c3 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: rcctl.sh,v 1.58 2015/01/06 12:49:55 ajacoutot Exp $ +# $OpenBSD: rcctl.sh,v 1.59 2015/01/06 14:48:59 ajacoutot Exp $ # # Copyright (c) 2014, 2015 Antoine Jacoutot # Copyright (c) 2014 Ingo Schwarze @@ -365,9 +365,8 @@ if [ -n "${var}" ]; then [[ ${action} == @(enable|set) && ${var} = flags && ${args} = NO ]] && \ _rc_err "${0##*/}: \"flags NO\" contradicts \"${action}\"" if svc_is_special ${svc}; then - if [[ ${var} != @(flags|status) || \ - ${action} != @(set|get|getdef|enable) ]] || \ - [[ ${action} == @(enable|set) && -n ${args} ]]; then + if [[ ${action} == @(enable|set) && ${var} != status ]] || \ + [[ ${action} == @(get|getdef) && ${var} == @(timeout|user) ]] ; then _rc_err "${0##*/}: \"${svc}\" is a special variable, cannot \"${action} ${svc} ${var}\"" fi fi -- 2.20.1