Date: Sun, 4 Nov 2012 21:35:41 GMT From: Stefan Esser <se@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/173366: FIB in Apache RC script vs. rc.subr Message-ID: <201211042135.qA4LZfLA023937@red.freebsd.org> Resent-Message-ID: <201211042140.qA4Le030031593@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 173366 >Category: ports >Synopsis: FIB in Apache RC script vs. rc.subr >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Nov 04 21:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Stefan Esser >Release: -CURRENT >Organization: FreeBSD.Org >Environment: FreeBSD x.y.z 10.0-CURRENT FreeBSD 10.0-CURRENT #24 r242481M: Fri Nov 2 17:23:22 CET 2012 root@x.y.z:/sys/amd64/compile/SE amd64 >Description: r242184 added setfib(1) support to rc.subr and assumes, that any non-blank value is a FIB number. But the RC script for apache sets "apache_fib" to "NO" if it does not contain a FIB number. This leads to a comamnd "setfib -F NO apache" and setfib complains about the non-zero value. I assume that the apache RC script should be modified to not pass apache22_fib="NO" for the case of no FIB. OTOH, the code in rc.subr could be changed to accept "NO" as equivalent to an empty value of the FIB variable. Setting "apache22_fib=0" just hides the problem. It does not harm, but the default of not specifying a FIB should just work. >How-To-Repeat: On a -CURRENT system with Apache try to start it wothout setting a FIB: # service apache22 start >Fix: The following patch lets rc.subr accept "NO" as equivalent to an empty xxx_fib variable. This patch is sufficient, but does not try to detect any permitted spelling of "NO" (vs. [Nn][Oo]). --- /usr/src/etc/rc.subr 2012-10-27 23:15:46.554124610 +0200 +++ /etc/rc.subr 2012-11-04 21:46:29.109476560 +0100 @@ -645,6 +645,10 @@ _group=\$${name}_group _groups=\$${name}_groups \ _fib=\$${name}_fib + if [ "x$_fib" = "xNO" ]; then + _fib= + fi + if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then unset _user >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211042135.qA4LZfLA023937>