From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 4 21:40:01 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07431DC for ; Sun, 4 Nov 2012 21:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CEB5C8FC14 for ; Sun, 4 Nov 2012 21:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4Le0Go031594 for ; Sun, 4 Nov 2012 21:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qA4Le030031593; Sun, 4 Nov 2012 21:40:00 GMT (envelope-from gnats) Resent-Date: Sun, 4 Nov 2012 21:40:00 GMT Resent-Message-Id: <201211042140.qA4Le030031593@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan Esser Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60994DF1 for ; Sun, 4 Nov 2012 21:35:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 48A1B8FC16 for ; Sun, 4 Nov 2012 21:35:41 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qA4LZfXs023968 for ; Sun, 4 Nov 2012 21:35:41 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qA4LZfLA023937; Sun, 4 Nov 2012 21:35:41 GMT (envelope-from nobody) Message-Id: <201211042135.qA4LZfLA023937@red.freebsd.org> Date: Sun, 4 Nov 2012 21:35:41 GMT From: Stefan Esser To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/173366: FIB in Apache RC script vs. rc.subr X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2012 21:40:01 -0000 >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: