From 9614593728164e144912f93b4bbca10b1d6a1aa9 Mon Sep 17 00:00:00 2001 From: kevans Date: Tue, 16 Jan 2018 20:14:31 +0000 Subject: [PATCH] service(8): Reset OPTIND properly now that we're parsing args twice r328032 introduced a second round of argument parsing to proxy the request through to a jail as needed, but failed to reset OPTIND before getting to the second round of parsing to allow other flags to be set. Reported by: Oleg Ginzburg --- usr.sbin/service/service.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 4433e36fd4db..ccc092828c7b 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -79,6 +79,7 @@ if [ -n "$JAIL" ]; then exit $? fi +OPTIND=1 while getopts ${accepted_argstr} COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in e) ENABLED=eopt ;;