Date: Wed, 17 Apr 2013 23:54:31 -0400 (EDT) From: William Orr <will@worrbase.com> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/177944: sabnzbdpluss rc script breaks on non-ip host values Message-ID: <20130418035432.0EFD51A3@puppies.worrbase.com> Resent-Message-ID: <201304180400.r3I400Xg032949@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130418035432.0EFD51A3>