1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-06 06:30:19 +00:00

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.
This commit is contained in:
Mikhail Teterin 2007-04-16 04:26:28 +00:00
parent e2dd491a7d
commit f9752c8ba0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=190071
4 changed files with 36 additions and 22 deletions

View File

@ -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 \

View File

@ -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"

View File

@ -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

View File

@ -1,4 +1,3 @@
etc/rc.d/socks5.sh
bin/socks5
bin/runsocks
bin/stopsocks