From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Feb 7 11:30:01 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6B5E16A469 for ; Thu, 7 Feb 2008 11:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7D49013C447 for ; Thu, 7 Feb 2008 11:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m17BU1KR059908 for ; Thu, 7 Feb 2008 11:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m17BU1dX059905; Thu, 7 Feb 2008 11:30:01 GMT (envelope-from gnats) Resent-Date: Thu, 7 Feb 2008 11:30:01 GMT Resent-Message-Id: <200802071130.m17BU1dX059905@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan `Sec` Zehl Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E1D316A417 for ; Thu, 7 Feb 2008 11:24:07 +0000 (UTC) (envelope-from sec@42.org) Received: from ice.42.org (v6.42.org [IPv6:2001:608:9::1]) by mx1.freebsd.org (Postfix) with ESMTP id F1EBE13C4F2 for ; Thu, 7 Feb 2008 11:24:05 +0000 (UTC) (envelope-from sec@42.org) Received: by ice.42.org (Postfix, from userid 1000) id 79AF0B848; Thu, 7 Feb 2008 12:24:04 +0100 (CET) Message-Id: <20080207112404.79AF0B848@ice.42.org> Date: Thu, 7 Feb 2008 12:24:04 +0100 (CET) From: Stefan `Sec` Zehl To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/120342: improvement of net/sendfile port X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stefan `Sec` Zehl List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 11:30:01 -0000 >Number: 120342 >Category: ports >Synopsis: improvement of net/sendfile port >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Thu Feb 07 11:30:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Stefan `Sec` Zehl >Release: FreeBSD 6.3-PRERELEASE i386 >Organization: >Environment: System: FreeBSD ice 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #41: Sat Jan 19 03:15:08 CET 2008 root@ice:/export/obj/export/src/sys/ICE i386 >Description: This update fixes the rc.d script of the net/sendfile port, and also improves the sendfile.cf handling by installing sendfile.cf.sample by default. >How-To-Repeat: >Fix: diff -burN sendfile/Makefile sendfile.new/Makefile --- sendfile/Makefile 2003-02-21 13:15:01.000000000 +0000 +++ sendfile.new/Makefile 2008-02-07 11:21:03.000000000 +0000 @@ -7,7 +7,7 @@ PORTNAME= sendfile PORTVERSION= 2.1a -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= ftp://ftp.belwue.de/pub/unix/sendfile/current/ DISTFILES= sendfile-20010216.tar.gz @@ -25,4 +25,13 @@ MAN8= sendfiled.8 MLINKS= utf7encode.1 utf7decode.1 +post-install: + @if [ ! -f ${PREFIX}/etc/sendfile.cf ]; then \ + ${CP} -p ${PREFIX}/etc/sendfile.cf.sample ${PREFIX}/etc/sendfile.cf ; \ + fi + @if [ ! -f ${PREFIX}/etc/sendfile.deny ]; then \ + ${CP} -p ${PREFIX}/etc/sendfile.deny.sample ${PREFIX}/etc/sendfile.deny ; \ + fi + ${INSTALL_SCRIPT} ${FILESDIR}/sendfiled.sh ${PREFIX}/etc/rc.d/ + .include diff -burN sendfile/files/patch-ab sendfile.new/files/patch-ab --- sendfile/files/patch-ab 2001-03-06 17:24:23.000000000 +0000 +++ sendfile.new/files/patch-ab 2008-02-07 11:02:30.000000000 +0000 @@ -1,5 +1,5 @@ ---- develop/install.orig Mon Mar 5 23:27:57 2001 -+++ develop/install Mon Mar 5 23:34:38 2001 +--- develop/install.orig 1999-12-07 09:40:11.000000000 +0000 ++++ develop/install 2008-02-07 11:02:26.000000000 +0000 @@ -82,7 +82,6 @@ make_man fetchfile 7 $manmisc make_man sendfiled 8 $manadmin @@ -23,6 +23,29 @@ umask 022 +@@ -233,16 +224,16 @@ + mv $NOSENDFILE $DENY + fi + fi +-if [ ! -f $DENY -a ! -f $ALLOW ]; then ++if [ ! -f ${DENY}.sample -a ! -f $ALLOW ]; then + echo "installing the sendfile deny file as $DENY" +- cp etc/sendfile.deny $DENY +- chmod 644 $DENY ++ cp etc/sendfile.deny ${DENY}.sample ++ chmod 644 ${DENY}.sample + fi + +-if [ ! -f $CONFIG ]; then ++if [ ! -f ${CONFIG}.sample ]; then + echo "installing the global sendfile config file as $CONFIG" +- cp etc/sendfile.cf $CONFIG +- chmod 644 $CONFIG ++ cp etc/sendfile.cf ${CONFIG}.sample ++ chmod 644 ${CONFIG}.sample + else + if [ "`diff etc/sendfile.cf $CONFIG`" ]; then + echo "Warning: `pwd`/etc/sendfile.cf differs from $CONFIG !" @@ -250,6 +241,23 @@ fi fi @@ -73,7 +96,16 @@ if [ ! -d "$SPOOL/OUTGOING" ]; then echo "creating $SPOOL" mkdir_recursive $SPOOL/OUTGOING -@@ -344,15 +351,12 @@ +@@ -334,7 +341,7 @@ + fi + + free=`$SERVERDIR/sendfiled -f` +-minfree=`awk '/minfree =/{print $3}' $CONFIG` ++minfree=`awk '/minfree =/{print $3}' ${CONFIG}.sample` + if [ "$free" -le "$minfree" ]; then + cat <${PREFIX}/etc/rc.d/sendfiled.sh -+chmod a+x ${PREFIX}/etc/rc.d/sendfiled.sh ++echo "### Please add 'sendfiled_enable=YES' to your /etc/rc.conf" if [ "$RESTART" = true ]; then - echo - echo "please restart now your inetd ( or simply reboot :-) )" ++ if [ ! -f /var/run/inetd.pid ] ; then ++ echo "# Cant restart inetd. Perhaps it isn't running?" ++ else + kill -HUP `cat /var/run/inetd.pid` ++ fi echo fi +[ -f $SERVERDIR/sendfiled.old ] && rm -f $SERVERDIR/sendfiled.old diff -burN sendfile/files/sendfiled.sh sendfile.new/files/sendfiled.sh --- sendfile/files/sendfiled.sh 1970-01-01 00:00:00.000000000 +0000 +++ sendfile.new/files/sendfiled.sh 2008-02-07 10:32:25.000000000 +0000 @@ -0,0 +1,32 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sendfiled +# REQUIRE: LOGIN +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `sendfiled': +# +#sendfiled_enable="YES" +# +# See sendfiled(8) for sendfiled_flags +# + +. "/etc/rc.subr" + +name="sendfiled" +rcvar=`set_rcvar` + +command="/usr/local/sbin/sendfiled" +command_args="-Q" +required_files="/usr/local/etc/sendfile.cf" + +# read configuration and set defaults +load_rc_config "$name" +: ${sendfiled_enable="NO"} +: ${sendfiled_flags=""} + +run_rc_command "$1" diff -burN sendfile/pkg-plist sendfile.new/pkg-plist --- sendfile/pkg-plist 2000-03-09 20:00:41.000000000 +0000 +++ sendfile.new/pkg-plist 2008-02-07 11:09:30.000000000 +0000 @@ -14,8 +14,6 @@ bin/utf7encode bin/wlock etc/rc.d/sendfiled.sh -etc/sendfile.cf -etc/sendfile.deny sbin/sendfiled @exec mkdir -p /var/spool/sendfile/OUTGOING /var/spool/sendfile/LOG @exec chmod 755 /var/spool/sendfile @@ -23,9 +21,16 @@ @exec chmod 700 /var/spool/sendfile/LOG @exec touch /var/spool/sendfile/LOG/in /var/spool/sendfile/LOG/out @exec chmod 600 /var/spool/sendfile/LOG/in /var/spool/sendfile/LOG/out -@exec echo -e 'saft\tstream\ttcp\tnowait\troot\t/usr/local/sbin/sendfiled sendfiled' >> /etc/inetd.conf +@exec echo -e 'saft\tstream\ttcp\tnowait\troot\t%D/sbin/sendfiled sendfiled' >> /etc/inetd.conf @exec echo -e 'saft\t\t487/tcp\t# simple asynchronous file transfer'>>/etc/services -@exec kill -HUP `ps auxw|awk '$11 == "inetd" { print $2 } '` +@exec kill -HUP `ps auxw|awk '$11 == "inetd" { print $2 } '` >/dev/null 2>&1 ||true @unexec perl -pi.bak -e '/^saft/ && ($_="")' /etc/inetd.conf -@unexec kill -HUP `ps auxw|awk '$11 == "inetd" { print $2 } '` -@unexec rm -R /var/spool/sendfile +@unexec kill -HUP `ps auxw|awk '$11 == "inetd" { print $2 } '` >/dev/null 2>&1||true +@unexec rm -R /var/spool/sendfile 2>&1 >/dev/null || true + +@unexec if cmp -s %D/etc/sendfile.cf.sample %D/etc/sendfile.cf; then rm -f %D/etc/sendfile.cf; fi +@exec if [ ! -f %D/etc/sendfile.cf ] ; then cp -p %D/etc/sendfile.cf.sample %D/etc/sendfile.cf; fi +@unexec if cmp -s %D/etc/sendfile.deny.sample %D/etc/sendfile.deny; then rm -f %D/etc/sendfile.deny; fi +@exec if [ ! -f %D/etc/sendfile.deny ] ; then cp -p %D/etc/sendfile.deny.sample %D/etc/sendfile.deny; fi +etc/sendfile.cf.sample +etc/sendfile.deny.sample >Release-Note: >Audit-Trail: >Unformatted: