summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ftp-proxy/ftp-proxy.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Exit early from rdaemon() is the passed fd is invalid.jca2016-09-261-1/+8
| | | | fd == -1 check suggested by deraadt@, ok florian@
* Go in the background later, using rdaemon().jca2016-09-151-8/+39
| | | | | | | | | | | | rdaemon() works like daemon(3) but requires its caller to pre-open /dev/null. This makes it possible to go in the background after a chroot(2), allowing for more error checking. The pattern is basically - open /dev/null - chroot - privdrop - rdaemon "design" initialy discussed with semarie@ a while ago, ok dlg@
* Exit early with an error if the "_ftp_proxy" user does not exist. This preventsajacoutot2016-02-121-1/+4
| | | | | | | | | rc.d waiting up to 30 secs when starting ftp-proxy right after updating from 5.8 because at that point sysmerge(8) would not have had a chance to run yet and the unpriv user would not exist. issue reported by sthen@ ok sthen@ benno@ jca@
* commiting -> committingmmcc2015-12-221-2/+2
|
* Make the NOPRIV_USER match that is actually intended to be used forsebastia2015-12-041-2/+2
| | | | | | | that. Problem introduced since tftp-proxy and ftp-proxy have separate nonpriv users. OK deraadt@
* switch to new _ftp_proxy user; ok dlgderaadt2015-12-011-2/+2
|
* Include <netinet/in.h> before <net/pfvar.h>. In a future change whenderaadt2015-01-211-3/+3
| | | | ports is ready, <net/pfvar.h> will stop including a pile of balony.
* Replace all queue *_END macro calls except CIRCLEQ_END with NULL.doug2014-09-131-2/+2
| | | | | | | | CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
* camield requested backout of rev 1.26, and indeed ftp-proxy does notbenno2013-03-151-45/+3
| | | | need it.
* handle ECONNABORTED errors from accept(). In many code blocks they can bederaadt2013-03-111-2/+4
| | | | | ignored silently and without aborting, much like EINTR and EWOULDBLOCK are. ok's from various maintainers of these directories...
* reserve a filedescriptor on accept() for subsequent connect() call, asbenno2013-03-101-3/+45
| | | | | done in relayd. ok sthen, deraadt
* Rate-limit accepting of new connections while we are experiencingcamield2012-04-051-6/+25
| | | | | | fd exhaustion. ok deraadt mikeb
* In preparation for getline and getdelim additions to libc, rename getline()fgsch2012-03-041-5/+5
| | | | | occurrences to get_line(). Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.
* Convert SO_RTABLE's protocol level to the SOL_SOCKET; ok claudiomikeb2011-06-211-4/+3
|
* switch ftp-proxy over to divert-to instead of rdr-to. this avoidsmikeb2011-04-281-7/+9
| | | | | an expensive state lookup (via natlook ioctl) and shrinks the code. tested by me and sthen, ok reyk sthen
* Use the rdomain information returned by DIOCNATLOOK to install theclaudio2011-03-251-13/+16
| | | | | | nat-to and rdr-to rules with correct rtable rule attributes. This allows to use ftp-proxy to proxy accross rdomains. Tested and OK phessler@, OK henning@
* Bring ftp-proxy in sync with the massive pf change just commited by Henning.claudio2009-09-011-28/+8
| | | | | | | | | | | | | This changes the way the rdr/nat rules are added to pf. Now only a single anchor is needed (the other ones do no longer exist). To convert your ruleset you need something like this at the start of your ruleset: # filter rules and anchors for ftp-proxy(8) anchor "ftp-proxy/*" pass in quick proto tcp to port ftp rdr-to 127.0.0.1 port 8021 This was tested by myself, sthen@, dlg@ and I think many more. OK by the same people plus henning.
* Better error messages. Include the function causing the problem and do notclaudio2008-06-131-7/+4
| | | | | include the program name in logmsg() plus exit_daemon() does not return so make it a void function. OK mpf@
* Flush output buffers before closing TCP session. Fixes the case wherejoel2008-04-221-1/+7
| | | | | | | | | | the proxy would eat the 221 response coming from the server towards the client. Patch from camield@. Tested by Camiel and myself. ok camield@
* Use arc4random_buf() when requesting more than a single word of outputdjm2008-04-131-3/+3
| | | | | | | Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
* Don't pass quick when tagging, so the tag can be used outsidehenning2008-02-261-2/+3
| | | | | | the ftp-proxy anchor. Exotic setups with route-to etc. can be implemented this way. from camield, ok reyk beck canacar and manpage polished by jmc
* Some servers / proxies out there like to open the data connectioncamield2007-08-151-11/+34
| | | | | | | | | | | | immediately after the client sends the PORT command. The "normal" behaviour is to wait for the client to actually request a transfer. Make ftp-proxy add the active mode rules immediately too, so that both scenario's work. ok david pyr Tested by Frank Denis, Stephan A. Rickauer, Ingo Schwarze, Stuart Henderson. Thanks.
* allow ftp-proxy to add tag statements to teh rules it insertshenning2007-08-011-5/+11
| | | | clever, nice and easy diff from bsd@openbsd.rutgers.edu, ok pyr reyk
* Remove stub write callback functions now that libevent allows them to be NULL.camield2006-12-301-19/+5
|
* Convert three instances of atoi() to strtonum() and apply sane upper bounds.camield2006-12-301-10/+12
| | | | | | Triggered by Rik/harry Bobbaers on bugs@. ok mbalmer@ ray@
* Ignore sigpipe as libevent does not handle that for us. Confirmed bycamield2006-12-121-1/+2
| | | | | | | | | provos. Fixes race condition where ftp-proxy would silently exit if a write was attempted on a socket that was closed by an RST. Should fix PR 5260. ok claudio@
* Close file descriptors before cleaning up the events, might cause a racecamield2006-10-151-6/+6
| | | | otherwise.
* unused variablecamield2006-03-251-3/+3
| | | | from Andrey Matveev
* Rework signal handling the idiomatic libevent way. From ospfd.camield2006-03-221-20/+25
| | | | ok claudio henning
* don't assume that close() can fail, from deraadtcamield2005-11-181-5/+3
| | | | ok henning deraadt
* buffer overflowderaadt2005-11-171-2/+3
|
* add OpenBSD cvs tags, prompted by xsa@camield2005-06-071-0/+2
|
* Introduce verbose option to control the logging of the pf rules.camield2005-06-071-4/+10
| | | | ok beck mpf
* Don't call va_start() when we do not log. From Andrey Matveev.camield2005-05-301-1/+2
|
* do not allow nul in the control connection.camield2005-05-271-4/+10
| | | | ok beck
* Import new FTP proxy. Handles IPv6 and all FTP modes. It wascamield2005-05-261-0/+1085
previously known as pftpx. Not connected to the builds yet. ok beck