The NetBSD Project

CVS log for src/libexec/ftpd/cmds.c

[BACK] Up to [cvs.NetBSD.org] / src / libexec / ftpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.35 / (download) - annotate - [select for diffs], Sun Jan 17 14:46:07 2016 UTC (8 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, HEAD
Changes since 1.34: +3 -4 lines
Diff to previous 1.34 (colored) to selected 1.26 (colored)

PR/50665: David Binderman: move "dir" to the outer scope so it stays alive
when the pointer is used later.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Aug 10 07:32:49 2015 UTC (8 years, 8 months ago) by shm
Branch: MAIN
Changes since 1.33: +5 -3 lines
Diff to previous 1.33 (colored) to selected 1.26 (colored)

Fix directory stream leaks

Revision 1.31.2.1 / (download) - annotate - [select for diffs], Wed Aug 20 00:02:22 2014 UTC (9 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored) next main 1.32 (colored) to selected 1.26 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.30.6.2 / (download) - annotate - [select for diffs], Thu May 22 11:37:13 2014 UTC (9 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.30.6.1: +5 -5 lines
Diff to previous 1.30.6.1 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored) to selected 1.26 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.33 / (download) - annotate - [select for diffs], Wed Jul 3 14:15:47 2013 UTC (10 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored) to selected 1.26 (colored)

check that stat succeeded before testing the guts of struct stat
(Manime Villard)

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jun 28 15:04:35 2013 UTC (10 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored) to selected 1.26 (colored)

Fix violations of the sequence point rule.

Revision 1.30.6.1 / (download) - annotate - [select for diffs], Tue Oct 30 18:59:21 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.30: +3 -5 lines
Diff to previous 1.30 (colored) to selected 1.26 (colored)

sync with head

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jun 19 06:06:34 2012 UTC (11 years, 10 months ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.30: +3 -5 lines
Diff to previous 1.30 (colored) to selected 1.26 (colored)

Pass WARNS=5

Revision 1.28.2.1 / (download) - annotate - [select for diffs], Wed May 13 19:18:37 2009 UTC (14 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.28: +12 -11 lines
Diff to previous 1.28 (colored) next main 1.29 (colored) to selected 1.26 (colored)

Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html

Revision 1.30 / (download) - annotate - [select for diffs], Sun Mar 15 07:48:36 2009 UTC (15 years, 1 month ago) by lukem
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.29: +8 -7 lines
Diff to previous 1.29 (colored) to selected 1.26 (colored)

Fix WARNS=4 issues (const & sign mismatches, etc)
Ensure various ftpd.conf values can't exceed their underlying types.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Mar 2 03:47:44 2009 UTC (15 years, 1 month ago) by lukem
Branch: MAIN
Changes since 1.28: +6 -6 lines
Diff to previous 1.28 (colored) to selected 1.26 (colored)

Use LLF (et al) instead of "%lld" (et al).

Revision 1.28 / (download) - annotate - [select for diffs], Mon Dec 29 00:33:34 2008 UTC (15 years, 3 months ago) by christos
Branch: MAIN
Branch point for: jym-xensuspend
Changes since 1.27: +5 -4 lines
Diff to previous 1.27 (colored) to selected 1.26 (colored)

fix for 64 bit time_t and dev_t

Revision 1.25.2.2 / (download) - annotate - [select for diffs], Wed Sep 24 16:35:51 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.25.2.1: +3 -3 lines
Diff to previous 1.25.2.1 (colored) to branchpoint 1.25 (colored) next main 1.26 (colored)

Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Sep 13 02:41:52 2008 UTC (15 years, 7 months ago) by lukem
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Crank copyright dates

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:29:54 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.25: +5 -4 lines
Diff to previous 1.25 (colored) to selected 1.26 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.24.18.2 / (download) - annotate - [select for diffs], Tue Jun 17 09:13:39 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.24.18.1: +5 -4 lines
Diff to previous 1.24.18.1 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored) to selected 1.26 (colored)

sync with head.

Revision 1.26 / (download) - annotate - [selected], Mon Jun 9 00:33:39 2008 UTC (15 years, 10 months ago) by lukem
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.25: +5 -4 lines
Diff to previous 1.25 (colored)

Don't use non-standard "u_<foo>" types.
Strip trailing whitespace (as well as ':'s) off PAM password prompts.
Improve some debug logging related to PAM.

Revision 1.24.18.1 / (download) - annotate - [select for diffs], Sun May 18 12:30:43 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-pf42
Changes since 1.24: +2 -9 lines
Diff to previous 1.24 (colored) to selected 1.26 (colored)

sync with head.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Apr 28 20:23:03 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base3, yamt-pf42-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Changes since 1.24: +2 -9 lines
Diff to previous 1.24 (colored) to selected 1.26 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.24 / (download) - annotate - [select for diffs], Wed Feb 1 14:20:12 2006 UTC (18 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-pf42
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored) to selected 1.26 (colored)

debug -> ftpd_debug
xstrdup -> ftpd_strdup

Revision 1.16.2.3 / (download) - annotate - [select for diffs], Tue Aug 31 01:35:21 2004 UTC (19 years, 7 months ago) by jmc
Branch: netbsd-1-6
Changes since 1.16.2.2: +7 -12 lines
Diff to previous 1.16.2.2 (colored) to branchpoint 1.16 (colored) next main 1.17 (colored) to selected 1.26 (colored)

Pullup rev 1.17-1.18,1.21-1.23 (requested by he in ticket #1739)

Update to NetBSD ftpd 20040809.  Fixes SA#2004-009.

Revision 1.4.2.5 / (download) - annotate - [select for diffs], Thu Aug 26 04:59:59 2004 UTC (19 years, 7 months ago) by jmc
Branch: netbsd-1-5
Changes since 1.4.2.4: +184 -30 lines
Diff to previous 1.4.2.4 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.26 (colored)

Pullup rev 1.13-1.18,1.20-1.23 (requested by he in ticket #158)

Update to NetBSD ftpd 20040809.  Fixes SA#2004-009.

Revision 1.22.2.1 / (download) - annotate - [select for diffs], Fri Aug 13 04:18:45 2004 UTC (19 years, 8 months ago) by jmc
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.22: +3 -4 lines
Diff to previous 1.22 (colored) next main 1.23 (colored) to selected 1.26 (colored)

Pullup rev 1.23 (requested by lukem in ticket #757)

* Fix yacc parser error recovery so that setjmp(3)/longjmp(3) is unnecessary.
* Fix SIGURG handler to set an urgflag that's later tested, rather than
  abusing setjmp(3)/longjmp(3).
* Use "volatile sig_atomic_t" as the type of variables modified by sig handlers.
* Use sigaction(3) instead of signal(3) to set the signal handlers.
* Only set the main SIGALRM handler once.  If we need to change it,
  cache the old handler and restore appropriately...
* Remove a bunch of signal races by improving the signal handlers.
* Fix memory leak with 'ESPV ALL'.
* Clean up the debug message in reply(); use vsnprintf(3) instead of vsyslog(3).
* Rework parsing of OOB commands to _not_ use the yacc parser, since the
  latter isn't reentrant and the hacks to work around that are ugly.
  We now examine urgflag at appropriate locations and call handleoobcmd()
  if it's set.  Since the only OOB commands we currently implement are
  ABOR and STAT, this isn't an issue.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 9 12:56:47 2004 UTC (19 years, 8 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.22: +3 -4 lines
Diff to previous 1.22 (colored) to selected 1.26 (colored)

Fixes from (or inspired by) OpenBSD:
* Fix yacc parser error recovery so that setjmp(3)/longjmp(3) is unnecessary.
* Fix SIGURG handler to set an urgflag that's later tested, rather than
  abusing setjmp(3)/longjmp(3).
* Use "volatile sig_atomic_t" as the type of variables modified by sig handlers.
* Use sigaction(3) instead of signal(3) to set the signal handlers.
* Only set the main SIGALRM handler once.  If we need to change it,
  cache the old handler and restore appropriately...
* Remove a bunch of signal races by improving the signal handlers.
* Fix memory leak with 'ESPV ALL'.

My stuff:
* Clean up the debug message in reply(); use vsnprintf(3) instead of vsyslog(3).
* Rework parsing of OOB commands to _not_ use the yacc parser, since the
  latter isn't reentrant and the hacks to work around that are ugly.
  We now examine urgflag at appropriate locations and call handleoobcmd()
  if it's set.  Since the only OOB commands we currently implement are
  ABOR and STAT, this isn't an issue.  (I also can't find the reference in
  RFC2228 where MIC, CONF & ENC are OOB-only commands.  Go figure.)
  I could clean up the is_oob stuff some more, but the remaining stuff
  in ftpcmd.y is harmless and it's unnecessary churn right this moment.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Aug 7 09:46:38 2003 UTC (20 years, 8 months ago) by agc
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.21: +3 -7 lines
Diff to previous 1.21 (colored) to selected 1.26 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22284, verified by myself.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Feb 24 19:25:25 2003 UTC (21 years, 1 month ago) by erh
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored) to selected 1.26 (colored)

Fix uninitialized variable in mlsname()

Revision 1.16.2.2 / (download) - annotate - [select for diffs], Sat Jan 11 23:13:17 2003 UTC (21 years, 3 months ago) by jmc
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Changes since 1.16.2.1: +137 -5 lines
Diff to previous 1.16.2.1 (colored) to branchpoint 1.16 (colored) to selected 1.26 (colored)

Pull up revisions 1.19-1.20 (requested by manu in ticket #1064)
 ftpd was unable to service the pwd request once you entered a directory
 without search permission. This confused some ftp clients.

 We fix this problem by maitaining a cached path when getcwd() does not
 work. The symbolic links and ../ are resolved in the cached path, and it
 is finnally checked for accuracy by comparing ./ and the cached path
 with stat (device and inode comparison). If the comparison fails, pwd
 fails as it did before, and if the comparison succeeds, the cached path
 is displayed.

 If paths are too long, we should just compare ./ with a truncated path
 and fail, thus making pwd displaying an error as it did before.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jan 8 18:07:31 2003 UTC (21 years, 3 months ago) by manu
Branch: MAIN
Changes since 1.19: +139 -7 lines
Diff to previous 1.19 (colored) to selected 1.26 (colored)

ftpd was unable to service the pwd request once you entered a directory
without search permission. This confused some ftp clients.

We fix this problem by maitaining a cached path when getcwd() does not work.
The symbolic links and ../ are resolved in the cached path, and it is finnally
checked for accuracy by comparing ./ and the cached path with stat (device
and inode comparison). If the comparison fails, pwd fails as it did before,
and if the comparison succeeds, the cached path is displayed.

If paths are too long, we should just compare ./ with a truncated path and
fail, thus making pwd displaying an error as it did before.

Revision 1.16.2.1 / (download) - annotate - [select for diffs], Fri Nov 1 08:23:39 2002 UTC (21 years, 5 months ago) by tron
Branch: netbsd-1-6
Changes since 1.16: +8 -2 lines
Diff to previous 1.16 (colored) to selected 1.26 (colored)

Pull up revision 1.19 (requested by itojun in ticket #942):
Turns out that our implementation of STAT wasn't RFC 959 compliant.
This version is now RFC 959 compliant, using a patch adapted from one
sent in by david.leonard@eecs.uq.edu.au
openbsd libexec/ftpd/ftpd.c revision 1.69.
(see RFC959 page 36)

Revision 1.4.2.4 / (download) - annotate - [select for diffs], Fri Oct 25 02:12:34 2002 UTC (21 years, 5 months ago) by itojun
Branch: netbsd-1-5
Changes since 1.4.2.3: +8 -2 lines
Diff to previous 1.4.2.3 (colored) to branchpoint 1.4 (colored) to selected 1.26 (colored)

libexec/ftpd/cmds.c				1.19

  Correct RFC959 compliance in quoting lines starting with digits (page 36).

(itojun)

Revision 1.19 / (download) - annotate - [select for diffs], Fri Oct 25 01:45:37 2002 UTC (21 years, 5 months ago) by itojun
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.18: +8 -2 lines
Diff to previous 1.18 (colored) to selected 1.26 (colored)

Turns out that our implementation of STAT wasn't RFC 959 compliant.
This version is now RFC 959 compliant, using a patch adapted from one
sent in by david.leonard@eecs.uq.edu.au

openbsd libexec/ftpd/ftpd.c revision 1.69.

(see RFC959 page 36)

Revision 1.18 / (download) - annotate - [select for diffs], Sat Oct 12 08:35:16 2002 UTC (21 years, 6 months ago) by darrenr
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored) to selected 1.26 (colored)

* enclose unknown command strings inside a pair of 's to clearly mark the
  text as being the 'whole' part received.
* change a HELP reply from 214 to 504 when there is an error looking for
  help on a command.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Oct 11 10:57:51 2002 UTC (21 years, 6 months ago) by darrenr
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored) to selected 1.26 (colored)

"Command not implemented." is 502, not 501 (RFC959, 4.2.1)

Revision 1.16 / (download) - annotate - [select for diffs], Wed Feb 13 15:15:23 2002 UTC (22 years, 2 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1
Branch point for: netbsd-1-6
Changes since 1.15: +34 -13 lines
Diff to previous 1.15 (colored) to selected 1.26 (colored)

Fixes for mlsd/mlst standards conformance issues (noted by Robert Elz):
- mlst shouldn't return cdir or pdir for type, only dir
- mlst should always provide a full path name
- mlsd should provide a full path name for the cdir entry.  (providing a
  full path name for the pdir entry is optional, and i punted on that).

Revision 1.15 / (download) - annotate - [select for diffs], Fri Feb 1 04:35:30 2002 UTC (22 years, 2 months ago) by lukem
Branch: MAIN
Changes since 1.14: +5 -4 lines
Diff to previous 1.14 (colored) to selected 1.26 (colored)

fix previous, and ensure that closedataconn() is only called after dataconn()
and with a non-NULL file pointer.  active transfers now work correctly again,
passive transfers work, and the data stream is only closed after a PASV or
EPSV if a successful connection was initiated with dataconn().

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jan 17 05:21:47 2002 UTC (22 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.13: +8 -3 lines
Diff to previous 1.13 (colored) to selected 1.26 (colored)

reject SIZE request for ascii file if it exceeds 10k.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Apr 25 01:46:25 2001 UTC (23 years ago) by lukem
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.26 (colored)

crank copyrights of files changed this year
remove superfluous byte_count update in send_file_list
crank version

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Thu Mar 29 14:14:17 2001 UTC (23 years ago) by lukem
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.4.2.2: +33 -26 lines
Diff to previous 1.4.2.2 (colored) to branchpoint 1.4 (colored) to selected 1.26 (colored)

sync ftpd to -current with the following revisions (for lukem/christos):
	Makefile	1.43-1.44
	cmds.c		1.7-1.8,  1.10-1.12
	conf.c		1.35-1.40
	extern.h	1.32-1.38
	ftpcmd.y	1.53-1.59
	ftpd.8		1.58-1.63
	ftpd.c		1.102-1.104,  1.106-1.122
	ftpd.conf.5	1.12-1.15
	ftpusers.5	1.8
	logwtmp.c	1.16
	popen.c		1.23-1.25
	version.h	1.28

a quick summary of user-visible changes;
	- fix glob DoS by using GLOB_LIMIT
	- add ftpd.conf directives `advertise', `maxfilesize', `sanenames'
	- add flags: -P dataport, -X - wuftpd style log entries,
	  -q/-Q - (en|dis)able pidfiles, -u/-U - (en|dis)able utmp,
	  -w/-W - (en|dis)able wtmp

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jan 9 06:07:01 2001 UTC (23 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored) to selected 1.26 (colored)

ensure replydirname() do not truncate the names.
From: Paul Janzen <pjanzen@foatdi.harvard.edu>

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jan 9 05:06:14 2001 UTC (23 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.10: +9 -6 lines
Diff to previous 1.10 (colored) to selected 1.26 (colored)

make sure we do not return stray " at the end of stirng, like bla"\0.
From: "William C. Allen" <allenwc@home.com>

Revision 1.10 / (download) - annotate - [select for diffs], Mon Dec 18 02:32:50 2000 UTC (23 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.9: +14 -10 lines
Diff to previous 1.9 (colored) to selected 1.26 (colored)

Features:

* Add ftpd.conf(5) directive `advertise'; change the address that is
  advertised to the client for PASV transfers. this may be useful in
  certain firewall/NAT environments.

  Feature requested in [bin/9606] by Scott Presnell.

* Add -X option; syslog wu-ftpd style xferlog messages, prefixed with
  `xferlog: '.  An example line from syslog (wrapped):
	Dec 16 18:50:24 odysseus ftpd[571]: xferlog: Sat Dec 16 18:50:24 2000
	2 localhost 3747328 /pub/WLW2K601.EXE b _ o a lukem@ FTP 0 * c

  These messages can be converted to a wu-ftpd style xferlog file
  suitable for parsing with third-party tools with something like:
	grep 'xferlog: ' /var/log/xferlog | \
	    sed -e 's/^.*xferlog: //' >wuxferlog

  The format is the same as the wu-ftpd xferlog entries (with the leading
  syslog stuff), but different from the wu-ftpd syslogged xferlog entries
  because the latter is not as easy to convert into the standard xferlog
  file format.

  The choice to only syslog the xferlog messages rather than append to
  a /var/log/xferlog file was made because the latter doesn't work to
  well in the situation where the logfile is rotated and compressed and
  a long-running ftpd still has a file-descriptor to the now nonexistant
  xferlog file, and the log message will then get lost.

  Feature requested in [bin/11651] by Hubert Feyrer.


Fixes:

* In ftpd(8), clarify the -a and -c options.

* More clarifications in ftpd.conf(5).

* Ensure that all ftpd.conf commands set a parameter back to sane defaults
  if an argument of `none' or bad settings are given.

* Support the `chroot' directive for `REAL' users too (for consistency).

* For `GUEST' users, store the supplied password in pw->pw_passwd for use
  later in the xferlog.

* If show_chdir_messages() is given a code of -1, flush the cache of
  visited directories.  Invoke show_chdir_messages(-1) in end_login().

* Only syslog session stats if logging is requested.

* Rename logcmd() -> logxfer(), and dolog() -> logremotehost().

* Use cprintf() instead of fprintf() where appropriate.

* Minor KNF, and make a couple of functions static that were declared static.

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Wed Dec 13 21:18:09 2000 UTC (23 years, 4 months ago) by he
Branch: netbsd-1-5
Changes since 1.4.2.1: +14 -8 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored) to selected 1.26 (colored)

Pull up revision 1.9 (requested by itojun):
  Fix a one-byte buffer overrun.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Dec 4 10:50:39 2000 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.8: +14 -8 lines
Diff to previous 1.8 (colored) to selected 1.26 (colored)

in replydirname(), avoid one-byte overrun.
From: Kristian Vlaardingerbroek <kris@obit.nl> (to bugs@openbsd)

Revision 1.8 / (download) - annotate - [select for diffs], Thu Nov 16 13:15:13 2000 UTC (23 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.7: +10 -10 lines
Diff to previous 1.7 (colored) to selected 1.26 (colored)

- new ftpd.conf directives:
	maxfilesize	set the maximum size of uploaded files
	sanenames	if set, only permit uploaded filenames that contain
			characters from the set "-+,._A-Za-z0-9" and that
			don't start with `.'

- new/changed command line options:
	-e emailaddr	define email address for %E (see below)
	-P dataport	use dataport as the dataport (instead of ctrlport-1)
	-q		use pid files to count users	[default]
	-Q		don't use pid files to count users
	-u		write entries to utmp
	-U		don't write entries to utmp	[default]
	-w		write entries to wtmp		[default]
	-W		don't write entries to wtmp

	  NOTE:	-U used to mean `write utmp entries'. Its meaning has changed
		so that it's orthogonal with -q/-Q and -w/-W. This isn't
		considered a major problem, because using -U isn't going to
		enable something you don't want, but will disable something
		you did want (which is safer).

- new display file escape sequences:
	%E	email address
	%s	literal `s' if the previous %M or %N wasn't ``1''.
	%S	literal `S' if the previous %M or %N wasn't ``1''.

- expand the description of building ~ftp/incoming to cover the
  appropriate ftpd.conf(5) directives (which are defaults, but it pays
  to explicitly explain them)

- replace strsuftoi() with strsuftoll(), which returns a long long if
  supported, otherwise a long

- rework the way that check_modify and check_upload are done in the yacc
  parser; they're merged into a common check_write() function which is
  called explicitly

- merge all ftpclass `flag variables' into a single bitfield-based flag element

- move various common bits of parse_conf() into a couple of macros

- clean up some comments

Revision 1.7 / (download) - annotate - [select for diffs], Wed Nov 15 02:32:30 2000 UTC (23 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored) to selected 1.26 (colored)

changes to improve portability:
* replace union sockunion {} with struct sockinet {}, and modify the code
  accordingly. this is possibly more portable, as it doesn't rely upon
  the structure alignment within the union for our own stuff.  uses local
  su_len unless HAVE_SOCKADDR_SA_LEN is defined (set ifdef BSD4_4)
  (XXX: haven't tested the ipv6 stuff)
* always use getaddrinfo() and getnameinfo() instead of maintaining two code
  paths. (lukemftpd will provide replacements for these on older systems)
* use lockf() instead of open(.., O_EXLOCK) to lock the pid file
* minor KNF
* clean up long long support: create helper #defines and use as appropriate:
        #define		NO_LONG_LONG	! NO_LONG_LONG
        -------		------------	--------------
        LLF		"%ld"		"%lld"
        LLFP(x)		"%" x "ld"	"%" x "lld"
        LLT		long		long long
        ULLF		"%lu"		"%llu"
        ULLFP(x)	"%" x "lu"	"%" x "llu"
        ULLT		unsigned long	unsigned long long
        STRTOLL(x,y,z)	strtol(x,y,z)	strtoll(x,y,z)

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Thu Jul 13 01:06:35 2000 UTC (23 years, 9 months ago) by thorpej
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Changes since 1.4: +35 -22 lines
Diff to previous 1.4 (colored) to selected 1.26 (colored)

Pull up revs. 1.4-1.6 (lukem):
fixes some issues with the correct generation of unique facts in
the output of MLSx.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jul 10 22:41:17 2000 UTC (23 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.5: +18 -10 lines
Diff to previous 1.5 (colored) to selected 1.26 (colored)

base64_encode(): separate out the special case for the last 2 bytes, and
be a bit safer with signed chars. per discussion with kre.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jul 9 14:26:34 2000 UTC (23 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.4: +26 -21 lines
Diff to previous 1.4 (colored) to selected 1.26 (colored)

- base64_encode(): fix garbled output due to fencepost error. output now
  appears to match that of 'mimencode' (from metamail).
  problem noted by kre@munnari.oz.au.
- fact_unique(): encode a combined dev_t+ino_t chunk rather than separate bits

Revision 1.4.4.2 / (download) - annotate - [select for diffs], Thu Jun 22 15:58:15 2000 UTC (23 years, 10 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.4.4.1: +787 -0 lines
Diff to previous 1.4.4.1 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.26 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.4.4.1, Mon Jun 19 17:08:05 2000 UTC (23 years, 10 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.4: +0 -787 lines
FILE REMOVED

file cmds.c was added on branch minoura-xpg4dl on 2000-06-22 15:58:15 +0000

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jun 19 17:08:05 2000 UTC (23 years, 10 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-5-base
Branch point for: netbsd-1-5, minoura-xpg4dl
Changes since 1.3: +10 -9 lines
Diff to previous 1.3 (colored) to selected 1.26 (colored)

rewrite method of traversing facttab[]; use size of list to terminate
not NULL terminated entry (since we need to know the size of other
reasons...)

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 19 15:15:03 2000 UTC (23 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.2: +122 -119 lines
Diff to previous 1.2 (colored) to selected 1.26 (colored)

various fixes suggested by Robert Elz:
* implement closedataconn() and use appropriately (including in mlsd())
* only put leading space in front of MLST output (not MLSD output)
* MLSD: only output pdir and cdir entries when the type fact is requested.
* change error code for giving MLSD a non-directory from 550 to 501
* remove MLSx Type fact support for UNIX.* for now; it's not standardised yet.
* do a check_login when MLSD and MLST are given no args
* detect & complain about null facts in OPTS MLST
* cache getgroups() at login instead of calling each time in fact_perm()

other mods:
* implement cprintf(); as per fprintf() but increments total_bytes{,_out}
* implement CPUTC(); as per putc() but increments total_bytes{,_out}
* implement base64_encode()
* fact_unique() display base64 encoding of dev_t and ino_t rather than
  hex output; should scale if size of those changes
* change reply() so that a negative code acts as the initial line in a reply,
  code == 0 prefixes the line with 4 spaces, and code > 0 works as before.
  deprecate lreply(code, ) and lreply(0, ) in favour of reply(-code, ) and
  reply(0, ) respectively.
* use cprintf() and CPUTC() appropriately (often instead of printf(),
  lreply(-2, ) or lreply(-1, ).
  now we actually account for the data sent by MLST and MLSD.
* remove DEBUG support for sending MLSD output to control connection instead
  of data connection (my ftp client now supports MLSD :-)

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 16 23:17:41 2000 UTC (23 years, 10 months ago) by explorer
Branch: MAIN
Changes since 1.1: +6 -2 lines
Diff to previous 1.1 (colored) to selected 1.26 (colored)

include <krb5/krb5.h> before including extern.h, so krb5_context is defined

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jun 14 13:44:22 2000 UTC (23 years, 10 months ago) by lukem
Branch: MAIN
Diff to selected 1.26 (colored)

major overhaul (just before netbsd 1.5 :-):

* implement draft-ietf-ftpext-mlst-10 commands, especially MLST and MLSD.
  we already supported SIZE and MDTM. add the appropriate FEAT output lines.

* migrate a lot of the command code from ftpcmd.y and ftpd.c to cmds.c

* make dataconn(), feat(), lookup(), opts() and sizecmd() public

* modify struct tab so that it has a `flags' instead of `implemented' element,
  and remove the `hasopts' element.  If flags == 1, the command is implemented.
  if flags == 2, the command is implemented and takes options

* add macros ISDOTDIR(x) (is x ".") and ISDOTDOTDIR(x) (is x "..")

* modify lreply() so that lreply(-2, ...) just outputs the given info without
  a prefix or trailing \r\n. this saves doing b = printf(); total_* += b;

* enhance statcmd(). still needs work in the LPRT status stuff.

* crank version

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>