ports/177944: sabnzbdpluss rc script breaks on non-ip host values

William Orr will at worrbase.com
Thu Apr 18 04:00:01 UTC 2013


>Number:         177944
>Category:       ports
>Synopsis:       sabnzbdpluss rc script breaks on non-ip host values
>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:   Thu Apr 18 04:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     William Orr
>Release:        FreeBSD 9.1-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD puppies.worrbase.com 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:
	The egrep regexp for sabnzbd's init script doesn't allow for non-IPv4 address values. Since hostnames and IPv6 addresses are valid options for the host field in the configuration file, I've submitted a patch that matches any host value, and set ${host} to it appropriately
>How-To-Repeat:
	stop sabnzbd with the host field in sabnzbd.ini set to a non-IPv4 address
>Fix:

	attached patch

--- sabnzbd-broken-rc-script.patch begins here ---
Index: files/sabnzbd.in
===================================================================
diff --git a/head/news/sabnzbdplus/files/sabnzbd.in b/head/news/sabnzbdplus/files/sabnzbd.in
--- a/head/news/sabnzbdplus/files/sabnzbd.in	(revision 316014)
+++ b/head/news/sabnzbdplus/files/sabnzbd.in	(working copy)
@@ -73,7 +73,7 @@
     echo "Stopping $name"
     if [ -f "${sabnzbd_conf_dir}/sabnzbd.ini" ]; then
         apikey=`grep ^api_key ${sabnzbd_conf_dir}/sabnzbd.ini | tr -d " _"`
-        host=`grep -m1 -E '^host\ =\ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9].'`
+        host=`grep -m1 -E '^host\ =\ .+' ${sabnzbd_conf_dir}/sabnzbd.ini | sed -e 's/^host = //'`
         if [ ${host} = "0.0.0.0" ] ; then host="localhost" ; fi
         port=`grep -m1 ^port ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9]'`
         fetch -o /dev/null "http://${host}:${port}/api?mode=shutdown&${apikey}" > /dev/null 2>&1
--- sabnzbd-broken-rc-script.patch ends here ---


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


More information about the freebsd-ports-bugs mailing list