Date: Tue, 6 Mar 2007 21:24:36 GMT From: Christian Ludwig<chrissicool@chrissicool.net> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/110011: New port: ftp/ftp-proxy a port of OpenBSD's ftp-proxy(8) Message-ID: <200703062124.l26LOavY077373@www.freebsd.org> Resent-Message-ID: <200703062130.l26LUBPM003205@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 110011 >Category: ports >Synopsis: New port: ftp/ftp-proxy a port of OpenBSD's ftp-proxy(8) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 06 21:30:11 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Christian Ludwig >Release: 6.2-stable >Organization: >Environment: FreeBSD chrissicool.shacknet.nu 6.2-STABLE FreeBSD 6.2-STABLE #5: Thu Mar 1 18:44:55 CET 2007 root@chrissicool.shacknet.nu:/usr/obj/usr/src/sys/KERNEL i386 >Description: Please find attached the FreeBSD port of ftp-proxy(8) from OpenBSD 4.0. There is already an older version in the base system, which is from OpenBSD 3.7. This one was completely rewritten and now uses pf's anchor facility. As it depends on libevent, I for one was unable to patch the version in the base system without major changes. A website tracking versions can be found at http://www.chrissicool.net/projects/ftp-proxy/ >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # ftp-proxy # ftp-proxy/Makefile # ftp-proxy/pkg-descr # ftp-proxy/distinfo # ftp-proxy/files # ftp-proxy/files/ftp-proxy.sh # ftp-proxy/pkg-message # echo c - ftp-proxy mkdir -p ftp-proxy > /dev/null 2>&1 echo x - ftp-proxy/Makefile sed 's/^X//' >ftp-proxy/Makefile << 'END-of-ftp-proxy/Makefile' X# New ports collection makefile for: ftp-proxy X# Date created: 4. March 2007 X# Whom: Christian Ludwig X# X# $FreeBSD$ X# X XPORTNAME= ftp-proxy XPORTVERSION= 4.0p0 XCATEGORIES= ftp XMASTER_SITES= http://www.chrissicool.net/projects/ftp-proxy/distfiles/ X XMAINTAINER= chrissicool@chrissicool.net XCOMMENT= A port of OpenBSD's ftp-proxy X XLIB_DEPENDS= event:${PORTSDIR}/devel/libevent X XMAN8= ftp-proxy.8 XMANCOMPRESSED= yes X XPLIST_FILES= sbin/ftp-proxy \ X etc/rc.d/ftp-proxy.sh X XCFLAGS+= -I${PREFIX}/include X X.include <bsd.port.pre.mk> X X.if ${OSVERSION} < 502106 XIGNORE= is only for 5.3 and above X.endif X Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/ftp-proxy ${PREFIX}/sbin X ${INSTALL_SCRIPT} ${FILESDIR}/ftp-proxy.sh ${PREFIX}/etc/rc.d X ${INSTALL_MAN} ${WRKSRC}/ftp-proxy.8.gz ${PREFIX}/man/man8 X X.include <bsd.port.post.mk> END-of-ftp-proxy/Makefile echo x - ftp-proxy/pkg-descr sed 's/^X//' >ftp-proxy/pkg-descr << 'END-of-ftp-proxy/pkg-descr' XA ftp proxy for firewalled connections, Xusing pf's anchors and rules. XThis is a port of the OpenBSD ftp-proxy. X XWWW: http://www.openbsd.org/ END-of-ftp-proxy/pkg-descr echo x - ftp-proxy/distinfo sed 's/^X//' >ftp-proxy/distinfo << 'END-of-ftp-proxy/distinfo' XMD5 (ftp-proxy-4.0p0.tar.gz) = 1defe7411ed13966910d1ec25784db86 XSHA256 (ftp-proxy-4.0p0.tar.gz) = cabd125a011d6548f40c72e29a254e71decde306f55ff5d037018cb33901867f XSIZE (ftp-proxy-4.0p0.tar.gz) = 13381 END-of-ftp-proxy/distinfo echo c - ftp-proxy/files mkdir -p ftp-proxy/files > /dev/null 2>&1 echo x - ftp-proxy/files/ftp-proxy.sh sed 's/^X//' >ftp-proxy/files/ftp-proxy.sh << 'END-of-ftp-proxy/files/ftp-proxy.sh' X#!/bin/sh X# X# $FreeBSD$ X# X X# PROVIDE: ftp-proxy X# REQUIRE: DAEMON X# X# NOTE for FreeBSD 5.0+: X# If you want this script to start with the base rc scripts X# move ftp-proxy.sh to /etc/rc.d/ftp-proxy X# Define these ftp-proxy_* variables in one of these files: X# /etc/rc.conf X# /etc/rc.conf.local X# /etc/rc.conf.d/ftp-proxy X# X# DO NOT CHANGE THESE DEFAULT VALUES HERE X# X Xftpproxy_enable=${ftp-proxy_enable:-"NO"} # Enable ftp-proxy Xftpproxy_flags=${ftp-proxy_flags:-""} # Flags to ftp-proxy program X#ftpproxy_program="%%PREFIX%%/sbin/ftp-proxy" # Location of ftp-proxy X X. %%RC_SUBR%% X Xname="ftp-proxy" Xrcvar=`set_rcvar` Xcommand="%%PREFIX%%/sbin/${name}" X Xload_rc_config $name X Xrun_rc_command "$1" END-of-ftp-proxy/files/ftp-proxy.sh echo x - ftp-proxy/pkg-message sed 's/^X//' >ftp-proxy/pkg-message << 'END-of-ftp-proxy/pkg-message' X=================================================================== XTo make use of the proxy, pf.conf(5) needs the following rules. All Xanchors are mandatory. Adjust the rules as needed. X XIn the NAT section: X X nat-anchor "ftp-proxy/*" X rdr-anchor "ftp-proxy/*" X rdr pass on $int_if proto tcp from $lan to any port 21 -> \ X 127.0.0.1 port 8021 X XIn the rule section: X X anchor "ftp-proxy/*" X pass out proto tcp from $proxy to any port 21 keep state X XAdd the following line to your /etc/rc.conf to enable the proxy on Xstartup: X X ftpproxy_enable="YES" X XPlease consult the man page ftp-proxy(8) for more information. X=================================================================== END-of-ftp-proxy/pkg-message exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703062124.l26LOavY077373>