From owner-svn-src-head@freebsd.org Wed Feb 28 17:20:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8991F368EC; Wed, 28 Feb 2018 17:20:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78AC3839BB; Wed, 28 Feb 2018 17:20:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7289F1C609; Wed, 28 Feb 2018 17:20:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SHKAfQ035078; Wed, 28 Feb 2018 17:20:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SHKAH3035077; Wed, 28 Feb 2018 17:20:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802281720.w1SHKAH3035077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Feb 2018 17:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330122 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 330122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 17:20:11 -0000 Author: emaste Date: Wed Feb 28 17:20:10 2018 New Revision: 330122 URL: https://svnweb.freebsd.org/changeset/base/330122 Log: rc.d/jail: avoid misinterpreting expr arguments (Due to some misconfiguration) I ended up with _mask set to "-v", and /etc/rc.d/jail then failed with "expr: illegal option -- v". Use "expr --" so that variable content is never interpreted as an option. Reviewed by: jamie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14535 Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Feb 28 16:24:32 2018 (r330121) +++ head/etc/rc.d/jail Wed Feb 28 17:20:10 2018 (r330122) @@ -316,7 +316,7 @@ jail_extract_address() # Extract the prefix/netmask/prefixlen part by cutting off the address. _mask=${_r} - _mask=`expr "${_mask}" : "${_addr}\(.*\)"` + _mask=`expr -- "${_mask}" : "${_addr}\(.*\)"` # Identify type {inet,inet6}. case "${_addr}" in @@ -366,8 +366,8 @@ jail_handle_ips_option() while [ ${#_x} -gt 0 ]; do case "${_x}" in *,*) # Extract the first argument and strip it off the list. - _i=`expr "${_x}" : '^\([^,]*\)'` - _x=`expr "${_x}" : "^[^,]*,\(.*\)"` + _i=`expr -- "${_x}" : '^\([^,]*\)'` + _x=`expr -- "${_x}" : "^[^,]*,\(.*\)"` ;; *) _i=${_x} _x=""