Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2014 12:50:56 GMT
From:      Daniel Ylitalo <daniel@203webgroup.se>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/186837: [PATCH] nrpe2 rc.d script uses hardcoded path
Message-ID:  <201402171250.s1HCoukM066136@cgiserv.freebsd.org>
Resent-Message-ID: <201402171300.s1HD00W1072669@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         186837
>Category:       ports
>Synopsis:       [PATCH] nrpe2 rc.d script uses hardcoded path
>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:   Mon Feb 17 13:00:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Ylitalo
>Release:        10.0-RELEASE
>Organization:
203 Webgroup AB
>Environment:
FreeBSD la-03-us.p203.se 10.0-RELEASE FreeBSD 10.0-RELEASE #0: Thu Jan 30 16:46:36 PST 2014     root@la-03-us.p203.se:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The nrpe2 rc.d file allows a user to change the location of the nrpe.cfg file.

If one were to do so the find_pidfile() function is hardcoded to look in the location of the default path.

Attaching patch.
>How-To-Repeat:
Change the location of the nrpe.cfg file in /etc/rc.conf with:
nrpe2_configfile="/your/random/location/nrpe.cfg"
and then move the default file there and try to restart nrpe2
>Fix:
See attached patch

Patch attached with submission follows:

--- /usr/local/etc/rc.d/nrpe2.orig      2014-02-17 04:41:58.000000000 -0800
+++ /usr/local/etc/rc.d/nrpe2   2014-02-17 04:43:36.000000000 -0800
@@ -37,7 +37,7 @@
        [ -n "$nrpe2_pidfile" ] &&
            warn "No longer necessary to set nrpe2_pidfile in rc.conf[.local]"

-       if get_pidfile_from_conf pid_file /usr/local/etc/nrpe.cfg; then
+       if get_pidfile_from_conf pid_file ${nrpe2_configfile}; then
                pidfile="$_pidfile_from_conf"
        else
                pidfile='%%PIDDIR%%/nrpe2.pid'

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402171250.s1HCoukM066136>