summaryrefslogtreecommitdiff
path: root/libexec/ftpd
Commit message (Collapse)AuthorAgeFilesLines
* MFC r314653:Enji Cooper2017-07-201-3/+2
| | | | | | | | | libexec: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output Notes: svn path=/stable/10/; revision=321267
* MFC r299585Don Lewis2016-05-201-3/+3
| | | | | | | | | | | | Declare line[] in the outermost scope of retrieve() instead of declaring it in an inner scope and then using it via a pointer in the outer scope. Reported by: Coverity CID: 605895 Notes: svn path=/stable/10/; revision=300273
* MFC: r262136Christian Brueffer2014-02-247-35/+7
| | | | | | | | | | Remove the 3rd clause ("advertising clause") of the BSD license as permitted by the University of Berkeley on July 22, 1999. Reviewed by: imp Notes: svn path=/stable/10/; revision=262435
* MFC: r261885Christian Brueffer2014-02-211-0/+2
| | | | | | | | | | | | In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya <t_uemura at macome.co.jp> Notes: svn path=/stable/10/; revision=262284
* Bump date missed in r202756Eitan Adler2012-09-141-1/+1
| | | | | | | | | | PR: docs/171624 Submitted by: bdrewery Approved by: gabor MFC after: 3 days Notes: svn path=/head/; revision=240506
* Spelling fixes for libexec/Ulrich Spörlein2012-01-071-1/+1
| | | | Notes: svn path=/head/; revision=229780
* Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]Colin Percival2011-12-232-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Add an API for alerting internal libc routines to the presence of "unsafe" paths post-chroot, and use it in ftpd. [11:07] Fix a buffer overflow in telnetd. [11:08] Make pam_ssh ignore unpassphrased keys unless the "nullok" option is specified. [11:09] Add sanity checking of service names in pam_start. [11:10] Approved by: so (cperciva) Approved by: re (bz) Security: FreeBSD-SA-11:06.bind Security: FreeBSD-SA-11:07.chroot Security: FreeBSD-SA-11:08.telnetd Security: FreeBSD-SA-11:09.pam_ssh Security: FreeBSD-SA-11:10.pam Notes: svn path=/head/; revision=228843
* Add LOGIN_SETCPUMASK and LOGIN_SETLOGINCLASS to the setusercontext(3)Edward Tomasz Napierala2011-06-221-6/+5
| | | | | | | calls in ftpd(8). Notes: svn path=/head/; revision=223434
* Make format string a string literal. (Discovered by clang.)Ed Maste2011-01-041-1/+1
| | | | | | | MFC After: 1 week Notes: svn path=/head/; revision=216945
* Handle failure from ftpd_popen in statfilecmd().Ed Maste2011-01-041-0/+4
| | | | | | | | Reviewed by: attilio MFC after: 1 week Notes: svn path=/head/; revision=216943
* expand checkuser() to support the propagation of error codes back toChristian S.J. Peron2011-01-031-8/+27
| | | | | | | | | | | | | | the caller. Currently, checkuser() does not differentiate between the failure to open the file and the absence of a user in the file. Check to see if there was an error opening the file. If there are any errors, terminate the connection. Currently, the only exception to this rule is ENOENT, since there is nothing that says the /etc/ftpuser and /etc/ftpchroot has to exist. MFC after: 3 weeks Notes: svn path=/head/; revision=216932
* mdoc: drop redundant .Pp and .LP callsUlrich Spörlein2010-10-081-2/+0
| | | | | | | They have no effect when coming in pairs, or before .Bl/.Bd Notes: svn path=/head/; revision=213573
* Check that gl_pathc is bigger than zero before derefencing gl_pathv.Xin LI2010-03-251-1/+2
| | | | | | | | | | | | When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD <contact davidberard fr> Obtained from: OpenBSD MFC after: 1 week Notes: svn path=/head/; revision=205656
* Set ut_line to "ftpd" for ftpd.Ed Schouten2010-02-091-0/+1
| | | | | | | | | | | This makes it a little easier to figure out which application was responsible for this log entry. Ideally we should add an ut_process or something similar. Suggested by: Vincent Poy <vincepoy gmail com> Notes: svn path=/head/; revision=203698
* Remove stale references to utmp(5) and its corresponding filenames.Ed Schouten2010-01-211-2/+1
| | | | | | | I removed utmp and its manpage, but not other manpages referring to it. Notes: svn path=/head/; revision=202756
* Really disable wtmp logging when chrooting.Ed Schouten2010-01-182-6/+9
| | | | | | | | | | | Also perform a small cleanup to ftpd_logwtmp(). Just use a NULL parameter for the username to indicate a logout, instead of an empty string. Reported by: Alexey Shuvaev <shuvaev physik uni-wuerzburg de> Notes: svn path=/head/; revision=202604
* Port ftpd to utmpx.Ed Schouten2010-01-132-52/+38
| | | | | | | | | | | Unfortunately I have to partially wreck its functionality, though. ftpd used to keep a file descriptor to the wtmp, which allowed it to work from within a chroot. The current utmpx implementation doesn't offer a way to do this. Maybe we can address this in the future, if it turns out to be a real issue. Notes: svn path=/head/; revision=202209
* Move variable externs into extern.h so they are checked against the definitions.David E. O'Brien2009-04-073-30/+29
| | | | Notes: svn path=/head/; revision=190828
* o Fix typo: indentical -> identical.Maxim Konovalov2009-01-301-1/+1
| | | | | | | | | PR: docs/131149 Submitted by: Patrick Oonk MFC after: 1 week Notes: svn path=/head/; revision=187913
* Prevent cross-site forgery attacks on ftpd(8) due to splittingColin Percival2008-12-233-8/+29
| | | | | | | | | | | | | | | | long commands into multiple requests. [08:12] Avoid calling uninitialized function pointers in protocol switch code. [08:13] Merry Christmas everybody... Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-08:12.ftpd, FreeBSD-SA-08:13.protosw Notes: svn path=/head/; revision=186405
* Remove references to S/Key and list OPIE.Tom Rhodes2007-04-201-8/+7
| | | | Notes: svn path=/head/; revision=168899
* Reword the description of the UTF8 option (-8) so I can swearYaroslav Tykhiy2007-04-191-14/+13
| | | | | | | | | to myself that I understand it. Bump document date. Notes: svn path=/head/; revision=168871
* Add support for RFC 2389 (FEAT) and RFC 2640 (UTF8) to ftpd(8).Yaroslav Tykhiy2007-04-183-3/+45
| | | | | | | | | | | | | | | | | The support for RFC 2640 (UTF8) is optional and rudimentary. The server just advertises its capability to handle UTF-8 file names and relies on its own 8-bit cleanness, as well as on the backward compatibility of UTF-8 with ASCII. So uploaded files will have UTF-8 names, but the initial server contents should be prepared in UTF-8 by hand, no on-the-fly conversion of file names will be done. PR: bin/111714 Submitted by: Zhang Weiwu <see email in the PR> MFC after: 1 week Notes: svn path=/head/; revision=168849
* Let automatic TCP send buffer sizing do its job for ftpd(8): stopYaroslav Tykhiy2007-02-091-9/+1
| | | | | | | | setting the SO_SNDBUF socket option. Using a hard-coded value for it was a poor idea anyway in the face of diverse network conditions. Notes: svn path=/head/; revision=166598
* Fix compilation of ftpcmd.y without -DINET6.Yaroslav Tykhiy2006-06-052-1/+8
| | | | | | | | | | Respect MK_INET6_SUPPORT in Makefile. Requested by: Attila Nagy <bra at fsn dot hu> MFC after: 1 week Notes: svn path=/head/; revision=159276
* Reimplementation of world/kernel build options. For details, see:Ruslan Ermilov2006-03-171-1/+3
| | | | | | | | | | | http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html The src.conf(5) manpage is to follow in a few days. Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine) Notes: svn path=/head/; revision=156813
* - Reduce needless DNS query by lookup only appropriate addressHajimu UMEMOTO2006-03-011-10/+20
| | | | | | | | | | | | | family. [1] - Specify appropriate hints to getaddrinfo(3). [1] - Obtain address family from peername in inet mode. Submitted by: Rostislav Krasny <rosti.bsd__at__gmail.com> [1] Tested by: yar, Rostislav Krasny <rosti.bsd__at__gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=156156
* Touch .Dd because the last commit was content-related.Yaroslav Tykhiy2006-01-291-1/+1
| | | | Notes: svn path=/head/; revision=154997
* In the daemon code, check for and report possible errorsYaroslav Tykhiy2006-01-211-14/+22
| | | | | | | | | | | | | from accept(2) and fork(2). Also close all unneeded fds in the child process, namely listening sockets for all address families and the fd initially obtained from accept(2). (The main ftpd code operates on stdin/stdout anyway as it has been designed for running from inetd.) MFC after: 5 days Notes: svn path=/head/; revision=154634
* The daemon's child shouldn't go on with the for loopYaroslav Tykhiy2006-01-211-6/+7
| | | | | | | | | | over ctl_sock's -- it is solely the parent daemon's job. So just break out of the loop in the child. MFC after: 5 days Notes: svn path=/head/; revision=154631
* Use pidfile(3) provided by libutil to manage the deamon's pid file.Yaroslav Tykhiy2006-01-212-30/+25
| | | | | | | | | | By default, create a pid file at the standard location, /var/run/ftpd.pid, in accord with the expected behavior of a stock system daemon. MFC after: 5 days Notes: svn path=/head/; revision=154630
* Add some consistency checks to the signal-related code.Yaroslav Tykhiy2005-02-161-0/+6
| | | | | | | MFC: along with rev. 1.202 Notes: svn path=/head/; revision=141967
* A call to maskurg() makes sense only when a transfer is under way,Yaroslav Tykhiy2005-02-161-3/+5
| | | | | | | | | | the function will emit an annoying log message otherwise. Reported by: kris MFC: along with rev. 1.202 Notes: svn path=/head/; revision=141966
* Fix most cases where the address of an int is passed to a function expecting aStefan Farfeleder2005-02-141-5/+8
| | | | | | | socklen_t * argument. Notes: svn path=/head/; revision=141918
* Respect the `logging' flag.Yaroslav Tykhiy2005-01-191-1/+1
| | | | | | | | Pointed out by: Nick Leuta MFC after: 3 days Notes: svn path=/head/; revision=140473
* Improve handling SIGURG and OOB commands on the control channel.Yaroslav Tykhiy2005-01-191-134/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | The major change is to process STAT sent as an OOB command w/o breaking the current data transfer. As a side effect, this gives better error checking in the code performing data transfers. A lesser, but in no way cosmetic, change is using the flag `recvurg' in the only signal-safe way that has been blessed by SUSv3. The other flag, `transflag,' becomes private to the SIGURG machinery, serves debugging purposes only, and may be dropped in the future. The `byte_count' global variable is now accounting bytes actually transferred over the network. This can give status messages looking strange, like "X of Y bytes transferred," where X > Y, but that has more sense than trying to compensate for combinations of data formats on the server and client when transferring ASCII type data. BTW, getting the size of a file in advance is unreliable for a number of reasons in the first place. See question 18.8 of the Infrequently Asked Questions in comp.lang.c for details. PR: bin/52072 Tested by: Nick Leuta (earlier versions), a stress-testing tool (final) MFC after: 1 month Notes: svn path=/head/; revision=140472
* Sort sections.Ruslan Ermilov2005-01-181-6/+6
| | | | Notes: svn path=/head/; revision=140414
* Replace err(3) calls when in daemon mode by syslog(3), too.Yaroslav Tykhiy2005-01-101-4/+8
| | | | | | | | | | A daemon has no stderr to send its complains to. Pointed out by: Nick Leuta MFC after: 1 week Notes: svn path=/head/; revision=139981
* NOPAM -> NO_PAMRuslan Ermilov2004-12-211-1/+1
| | | | Notes: svn path=/head/; revision=139126
* Do a small style(9) fix before I'm hacking the code itself.Yaroslav Tykhiy2004-12-161-1/+0
| | | | Notes: svn path=/head/; revision=138911
* free(3) is void already.Yaroslav Tykhiy2004-12-161-1/+1
| | | | Notes: svn path=/head/; revision=138910
* Never emit a message to stderr: use syslog instead.Yaroslav Tykhiy2004-12-121-9/+15
| | | | | | | | | | | | | When in inetd mode, this prevents bogus messages from appearing on the control channel. When running as a daemon, we shouldn't write to the terminal we used to have at all. PR: bin/74823 MFC after: 1 week Notes: svn path=/head/; revision=138747
* When looking for a virtual host to handle the connection,Yaroslav Tykhiy2004-11-221-2/+3
| | | | | | | | | stop the search on the first match for efficiency. Submitted by: Nick Leuta Notes: svn path=/head/; revision=137987
* Calling pam_chauthtok() isn't really needed sinceYaroslav Tykhiy2004-11-221-7/+3
| | | | | | | | | an FTP user has no chance to change password anyway. Submitted by: Nick Leuta Notes: svn path=/head/; revision=137986
* Don't log the chroot dir on every command since it's constant for a session.Yaroslav Tykhiy2004-11-221-9/+8
| | | | | | | | | | Log it once at the beginning of the session instead. OTOH, log wd each time for the sake of better auditing and consistent log format. Proposed by: Nick Leuta <skynick -at- mail.sc.ru> Notes: svn path=/head/; revision=137985
* Always log remote IP.Yaroslav Tykhiy2004-11-221-13/+9
| | | | | | | PR: bin/59773 Notes: svn path=/head/; revision=137984
* Treat host name buffers consistently.Yaroslav Tykhiy2004-11-221-12/+23
| | | | Notes: svn path=/head/; revision=137983
* Make chrootdir global and use it in log messagesYaroslav Tykhiy2004-11-181-9/+4
| | | | | | | | | regarding restricted users. MFC after: 2 weeks Notes: svn path=/head/; revision=137862
* Nitpicking on style(9) and whitespace.Yaroslav Tykhiy2004-11-181-13/+13
| | | | | | | Tested with: md5(1) Notes: svn path=/head/; revision=137861
* Use __FBSDID.Yaroslav Tykhiy2004-11-184-8/+12
| | | | Notes: svn path=/head/; revision=137859