summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2007-04-16 04:26:28 +0000
committerMikhail Teterin <mi@FreeBSD.org>2007-04-16 04:26:28 +0000
commitf9752c8ba0c536de322b124b392e7b73d6521edb (patch)
treed327dcffe18da079457261acfc1d64e1c7b765e6 /net
parent[patch] cleanup non-supported FreeBSD versions (diff)
A long-standing issue in the vendor's reimplementation of vsnprintf()
was not only inefficient (writing out to a file and then reading back!), but also had a bug in its handling of va_args. The most obvious ill-effect was the daemon crashing shortly after start-up on amd64. The inefficientcy was less obvious, but still there on all platforms. Although log.c contained HAVE_VSNPRINTF ifdef-s, the configure script does not check for the function's presence and never sets the define. Add the -DHAVE_VSNPRINTF as a simple work-around... Bump PORTREVISION. Approved by: maintainer While here, ditch the ancient socks5.sh.sample in favor of the proper USE_RC_SUBR script based on the maintainer-supplied code.
Notes
Notes: svn path=/head/; revision=190071
Diffstat (limited to 'net')
-rw-r--r--net/socks5/Makefile4
-rw-r--r--net/socks5/files/socks5.sh.in33
-rw-r--r--net/socks5/files/socks5.sh.sample20
-rw-r--r--net/socks5/pkg-plist1
4 files changed, 36 insertions, 22 deletions
diff --git a/net/socks5/Makefile b/net/socks5/Makefile
index 8b53d99b4d0f..aef65447e3d3 100644
--- a/net/socks5/Makefile
+++ b/net/socks5/Makefile
@@ -7,7 +7,7 @@
PORTNAME= socks5
PORTVERSION= 1.0.11
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= net security
MASTER_SITES= http://freeware.sgi.com/source/socks5/
DISTNAME= socks5-v1.0r11
@@ -15,6 +15,7 @@ DISTNAME= socks5-v1.0r11
MAINTAINER= josh@tcbug.org
COMMENT= SOCKS v5 application layer gateway and clients
+USE_RC_SUBR= ${PORTNAME}.sh
NO_CDROM= "NEC has a funky license for this software"
RESTRICTED= "no commercial use"
@@ -31,6 +32,7 @@ CONFLICTS= dante-[0-9]*
WRKSRC= ${WRKDIR}/${DISTNAME}
INSTALLS_SHLIB= yes
GNU_CONFIGURE= yes
+CFLAGS+= -DHAVE_VSNPRINTF
CONFIGURE_ARGS= --with-libconffile=${PREFIX}/etc/libsocks5.conf \
--with-srvconffile=${PREFIX}/etc/socks5.conf \
--with-srvpidfile=/var/run/socks5.pid \
diff --git a/net/socks5/files/socks5.sh.in b/net/socks5/files/socks5.sh.in
new file mode 100644
index 000000000000..6a7db4ab715d
--- /dev/null
+++ b/net/socks5/files/socks5.sh.in
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+#
+# PROVIDE: socks5
+# REQUIRE: DAEMON
+#
+# Add the following line to /etc/rc.conf to enable socks5
+#
+# socks5_enable="YES"
+#
+
+socks5_enable=${socks5_enable-"NO"}
+
+. /etc/rc.subr
+
+name=socks5
+rcvar=`set_rcvar`
+pidfile="/var/run/$name.pid-1080"
+
+command=%%PREFIX%%/bin/socks5
+
+stop_cmd=socks5_stop
+
+socks5_stop()
+{
+ echo "Stopping socks5."
+ kill -9 `cat ${pidfile}`
+ rm ${pidfile}
+}
+
+load_rc_config ${name}
+
+run_rc_command "$1"
diff --git a/net/socks5/files/socks5.sh.sample b/net/socks5/files/socks5.sh.sample
deleted file mode 100644
index 77d485d3959c..000000000000
--- a/net/socks5/files/socks5.sh.sample
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/bin/socks5 -a -f ${PREFIX}/etc/socks5.conf ] && ${PREFIX}/bin/socks5 && echo -n ' socks5'
- ;;
-stop)
- killall socks5 && echo -n ' socks5'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/net/socks5/pkg-plist b/net/socks5/pkg-plist
index caacd822b1e4..3ee9d11bbfe3 100644
--- a/net/socks5/pkg-plist
+++ b/net/socks5/pkg-plist
@@ -1,4 +1,3 @@
-etc/rc.d/socks5.sh
bin/socks5
bin/runsocks
bin/stopsocks