head	1.2;
access;
symbols
	NetBSD-20230930:1.1.1.12
	NetBSD-20230922:1.1.1.12
	NetBSD-20200615:1.1.1.11
	NetBSD-20190129:1.1.1.10
	NetBSD:1.1.1
	NetBSD-20130321:1.1.1.9
	NetBSD-20091107:1.1.1.8
	NetBSD-20080921:1.1.1.6
	NetBSD-20080609:1.1.1.5
	NetBSD-20080504:1.1.1.5
	tnftpd-20080504:1.1.1.4
	NetBSD-20060923:1.1.1.3
	NetBSD-20041201:1.1.1.2
	NetBSD-20040809:1.1.1.2
	NetBSD-20031210:1.1.1.2
	NetBSD-20030226:1.1.1.1
	NetBSD-20030223:1.1.1.1
	NetBSD-20021208:1.1.1.1
	NetBSD-20021026:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2002.10.26.12.22.51;	author lukem;	state dead;
branches;
next	1.1;

1.1
date	2002.09.18.06.24.34;	author lukem;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.09.18.06.24.34;	author lukem;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2003.07.28.13.32.57;	author lukem;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2006.03.24.02.44.47;	author lukem;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2008.03.27.08.12.09;	author lukem;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2008.06.01.03.26.12;	author lukem;	state Exp;
branches;
next	1.1.1.6;

1.1.1.6
date	2008.09.21.14.12.35;	author lukem;	state Exp;
branches;
next	1.1.1.7;

1.1.1.7
date	2009.03.15.07.48.36;	author lukem;	state Exp;
branches;
next	1.1.1.8;

1.1.1.8
date	2009.11.07.03.13.49;	author lukem;	state Exp;
branches;
next	1.1.1.9;

1.1.1.9
date	2013.03.21.00.30.37;	author lukem;	state Exp;
branches;
next	1.1.1.10;

1.1.1.10
date	2019.01.29.11.52.39;	author lukem;	state Exp;
branches;
next	1.1.1.11;
commitid	l6OjpXFHi3tdPF9B;

1.1.1.11
date	2020.07.04.03.31.37;	author lukem;	state Exp;
branches;
next	1.1.1.12;
commitid	BERDnmCwsbJigIeC;

1.1.1.12
date	2023.09.23.05.26.58;	author lukem;	state Exp;
branches;
next	;
commitid	HXbfxKFYXNz82RFE;


desc
@@


1.2
log
@- convert to using tnftpd.h
- generate the man pages
- crank the version back to 2.0 beta 1
- remove now unnecessary files
@
text
@#	$NetBSD: Makefile,v 1.1 2002/09/18 06:24:34 lukem Exp $
#	@@(#)Makefile	8.2 (Berkeley) 4/4/94

.include <bsd.own.mk>

PROG=	ftpd
SRCS=	cmds.c conf.c ftpd.c ftpcmd.y logutmp.c logwtmp.c popen.c
CPPFLAGS+=-I${.CURDIR} -DSUPPORT_UTMP -DSUPPORT_UTMPX
DPADD+=	${LIBCRYPT} ${LIBUTIL}
LDADD+=	-lcrypt -lutil
MAN=	ftpd.conf.5 ftpusers.5 ftpd.8
MLINKS=	ftpusers.5 ftpchroot.5

# for `internal' ls
SRCS+=	ls.c cmp.c print.c stat_flags.c util.c
.PATH:	${NETBSDSRCDIR}/bin/ls

CPPFLAGS+=-DINET6
.include <bsd.own.mk>

WARNS=2

.if (${USE_SKEY} != "no")
CPPFLAGS+=-DSKEY
DPADD+= ${LIBSKEY}
LDADD+= -lskey
.endif

ftpd.o ftpcmd.o: version.h

# XXX Kerberos support is broken right now.
#.PATH:	${NETBSDSRCDIR}/usr.bin/login

#.ifdef KERBEROS5
#SRCS+=	k5login.c
#CPPFLAGS+=-DKERBEROS5
#DPADD+= ${LIBKRB5} ${LIBK5CRYPTO} ${LIBCOM_ERR}
#LDADD+= -lkrb5 -lk5crypto -lcom_err
#.else
#SRCS+=	klogin.c
#CPPFLAGS+=-DKERBEROS
#DPADD+= ${LIBKRB} ${LIBDES} ${LIBCOM_ERR}
#LDADD+= -lkrb -kdes -lcom_err
#.endif

.include <bsd.prog.mk>
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.50 2002/09/18 06:24:34 lukem Exp $
@


1.1.1.1
log
@NetBSD's libexec/ftpd from 20021026
@
text
@@


1.1.1.2
log
@Sync to NetBSD ftpd 20031210.  Notable changes:
    *	Move UCB-licensed code from 4-clause to 3-clause licence.
	Patches provided by Joel Baker in PR 22284
    *	Add ftpd_loginx() and ftpd_logwtmpx() and use them to hold wtmpx file
	open while a session.  Close bin/21692 by bqt@@Krille.Update.UU.SE.
    *	Fix typos accidentally introduced in rev 1.70 as part of the large
	number support.  (NetBSD yacc didn't barf on these, although Solaris
	and HP/UX's did...)
    *	Don't declare "yylex()" static; AFAICT it shouldn't be, and it causes
	build problems with the output of some versions of yacc.
    *	Use sysconf(_SC_LOGIN_NAME_MAX) to determine the length of login
	names, rather than assuming LOGIN_NAME_MAX.  Based on patch from
	Garrett Wollman via David O'Brien (both at FreeBSD.org)
    *	netbsd.org->NetBSD.org
    *	Move Jason Downs's code from a 4-clause to a 3-clause licence by
	removing the advertising clause.  Diffs provided in PR 22410 by Joel
	Baker, confirmed to the board by Jason Downs.
	With additional thanks to Jason Thorpe.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.51 2003/07/23 08:01:27 itojun Exp $
d31 1
a31 2
#.if (${USE_KERBEROS} != "no")
#
d33 2
a34 1
#
d37 7
a43 12
#CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
#DPADD+=	${LIBKRB5} ${LIBASN1}
#LDADD+= -lkrb5 -lasn1
#
#SRCS+= klogin.c
#CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
#DPADD+=	${LIBKRB}
#LDADD+= -lkrb
#
#DPADD+=	${LIBCRYPTO} ${LIBROKEN} ${LIBCOM_ERR}
#LDADD+=	-lcrypto -lroken -lcom_err
#
@


1.1.1.3
log
@Import NetBSD-ftpd 20060923:
* Rename debug -> ftpd_debug, xstrdup -> ftpd_strdup
* Fix comment about DEFAULT_UMASK.
  Pointed out in private mail by Tetsuya Isaki and Dmitry Sivachenko.
* Add recvbufsize configuration option.
  This allows for setting the passive socket's SO_RCVBUF.  Option works
  similarly to the current sendbufsize configuration option.
* Change how recveive_data() works.
  When reading data from the socket for passive transfers to the server,
  receive_data() now works very similar to send_data_with_read().  Reads
  from the network are now done using either the filesystem block size or
  the configuration option readsize chunks.
* Add hidesymlinks configuration option.
  This adds a -L to all ls command arguments so that the file or directory
  the link references is listed rather than the link itself.  This was
  inspired by IRIX ftpd's -S option.
* Change _PATH_FOO to _NAME_FOO where FOO is not a path.
* Reorder some declarations so that parsers generated by bison can compile.
  Fix from Michael Richardson.
* Implement option "-D", for running ftpd in standalone mode (daemon).
  ftpd will listen on the default FTP port for incoming connections and fork
  a child for each connection.  This is lower overhead than starting ftpd from
  inetd(8) and thus might be useful on busy servers to reduce load.
  Inspired by FreeBSD.
* Change (mostly) int to socklen_t.  GCC 4 doesn't like that int and
  socklen_t are different signness.
* Remove unreachable code (res could never be NULL here).
  Fixes Coverity CID 712.
* Set file to NULL after calling fclose().
  Fixes Coverity CID 2669.
* Make sure that "su" is initialized before dereferencing it.
  Fixes Coverity CID 1075.
* Fix some typos.
* NLST should return 450 instead of 550 upon error, per RFC 959.
* logxfer(): don't use the same buffer to store the results of two separate
  concurrent realpath(3)s, otherwise we'll log the wrong information
  for a rename.
  Noted by Dmitry Sivachenko in private mail.
* s/getpwnam/sgetpwnam/ Found by John Nemeth.
* Add PAM and LOGIN_CAP support. Mostly from FreeBSD. If pam is defined,
  then we don't fall back to other authentications even if PAM fails due
  to a system error (e.g. configuration problem).
* Fix inverted test for expired passwords.
* Cleanup utmp and utmpx support.
	- make them symmetric
	- add a function to open the wtmp file explicitly very early in the game
* Apply patch from PR bin/33261 sent by FUKAOMI Naoki:
  "ftpd does not update wtmpx".
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.56 2006/03/23 20:14:16 wiz Exp $
d8 1
a8 1
CPPFLAGS+=-I${.CURDIR} -DSUPPORT_UTMP -DSUPPORT_UTMPX -DLOGIN_CAP
a17 1
.if (${USE_INET6} != "no")
d19 1
a19 1
.endif
a27 5
.if (${USE_PAM} != "no")
CPPFLAGS+=-DUSE_PAM
DPADD+= ${LIBPAM} ${PAM_STATIC_DPADD}
LDADD+= -lpam ${PAM_STATIC_LDADD}
.endif
d41 7
a47 2
#DPADD+=	${LIBCRYPTO} ${{LIBCRYPT} ${LIBROKEN} ${LIBCOM_ERR}
#LDADD+=	-lcrypto -lcrypt -lroken -lcom_err
@


1.1.1.4
log
@Import NetBSD-ftpd from 20080504.  Changes include:
* Reorganize USE_PAM so that the PAM conversation has a chance to
  display a custom message in the 331 reply to USER.
* Remove clause 3 and 4 from TNF licenses
* Switch from lockf() to (more portable) fcntl() locking
* Rename HAVE_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_SA_LEN.
* Use defined(HAVE_foo) instead of just testing HAVE_foo.
* Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659.
* Explicitly note the unsupported requests from RFC 2228.
* Improvements from FreeBSD:
  - Document `ftp-chroot' from login.conf(5).
  - Document that SIZE is prevented for files > 10240 bytes via ASCII transfers.
* Add -n option to display addresses in logs.
* Rename cred_t to ftpd_cred_t; the former causes a nameclash on Solaris.
* Expand documentation on numeric argument suffix parsing, and convert
  to IEC 60027-2 prefixes for 2^n multiples ("KiB" instead of "KB", etc.)
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.58 2008/03/27 08:12:09 lukem Exp $
d15 1
a15 1
SRCS+=	ls.c cmp.c print.c util.c
d24 5
a32 5
.else	# USE_PAM == no
.if (${USE_SKEY} != "no")
CPPFLAGS+=-DSKEY
DPADD+= ${LIBSKEY}
LDADD+= -lskey
a33 1
.endif	# USE_PAM == no
@


1.1.1.5
log
@Import NetBSD-ftpd from 20080504.  Changes include:
* Reorganize USE_PAM so that the PAM conversation has a chance to
  display a custom message in the 331 reply to USER.
* Remove clause 3 and 4 from TNF licenses
* Switch from lockf() to (more portable) fcntl() locking
* Rename HAVE_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_SA_LEN.
* Use defined(HAVE_foo) instead of just testing HAVE_foo.
* Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659.
* Explicitly note the unsupported requests from RFC 2228.
* Improvements from FreeBSD:
  - Document `ftp-chroot' from login.conf(5).
  - Document that SIZE is prevented for files > 10240 bytes via ASCII transfers.
* Add -n option to display addresses in logs.
* Rename cred_t to ftpd_cred_t; the former causes a nameclash on Solaris.
* Expand documentation on numeric argument suffix parsing, and convert
  to IEC 60027-2 prefixes for 2^n multiples ("KiB" instead of "KB", etc.)
@
text
@d1 1
a1 2
#	$NetBSD$
#	from	NetBSD: Makefile,v 1.58 2008/03/27 08:12:09 lukem Exp
@


1.1.1.6
log
@Sync to NetBSD-ftpd 20080921:
* Don't split large commands into multiple commands; just fail on them.
  This prevents CSRF-like attacks, when a web browser is used to access
  an ftp server.
  Reported by Maksymilian Arciemowicz <cxib@@securityreason.com>.
  Fix mostly derived from OpenBSD, written by Moritz Jodeit
  <moritz@@OpenBSD.org>
* Enhance -C to support an optional @@host ('-C user[@@host]'):
  checks whether user as connecting from host would be granted
  access by ftpusers(5).
  Support IPv6 in the host directive of ftpusers(5).
  Both features from Rudolf Cejka <cejkar@@fit.vutbr.cz>
  (FreeBSD's tnftpd port maintainer).
@
text
@d2 1
a2 1
#	from	NetBSD: Makefile,v 1.59 2008/09/16 12:23:28 lukem Exp
a14 3
.if defined(NO_INTERNAL_LS)
CPPFLAGS+=-DNO_INTERNAL_LS
.else
a17 1
.endif
@


1.1.1.7
log
@Sync to NetBSD-ftpd 20091107:
* Fix WARNS=4 issues (const & sign mismatches, etc)
* Ensure various ftpd.conf values can't exceed their underlying types.
* Fix for 64 bit time_t and dev_t
* Rename internal getline() function to get_line() so it does
  conflict with the getline(3) libc function.
* Log both the hostname and numeric address.
* Improve man page mdoc formatting
@
text
@d1 2
a2 1
#	$NetBSD: Makefile,v 1.60 2009/03/15 07:48:36 lukem Exp $
d27 2
@


1.1.1.8
log
@reimport; this time after munging the RCSIDs...
@
text
@d1 1
a1 2
#	$NetBSD$
#	from	NetBSD: Makefile,v 1.60 2009/03/15 07:48:36 lukem Exp
@


1.1.1.9
log
@Import NetBSD-ftpd 20100320:
- Fix warnings and build issues
- Fix memcpy usage
- Fix remote crash (fix was already pulled up manually to tnftpd).  PR/43023
- Reduce priority of syslog message if getpeername returns ENOTCONN.  PR/18934
@
text
@d2 1
a2 1
#	from	NetBSD: Makefile,v 1.63 2011/08/14 11:46:28 christos Exp
d47 1
@


1.1.1.10
log
@Import NetBSD ftpd as at 20190129

Notable changes:
- Fix violations of the sequence point rule.
- Add volatile for gcc 5.
- Check that stat and fstat succeed.
- Support blacklistd(8) hooks.
- Clear utmpx struct before writing it to wtmpx files.
- Fix directory stream leaks.
- Use explicit_memset(3) instead of memset(3) to clear password.
- Fix scope of variable. PR misc/50665.
- Ensure that closing socket exists. CID 603440.
- Add -f option to ftpd to stay in foreground with -D. PR bin/53221.
- Update version to "NetBSD-ftpd 20180428".
@
text
@d2 1
a2 1
#	from	NetBSD: Makefile,v 1.65 2018/02/25 00:16:48 mrg Exp
a14 4
SRCS+=	pfilter.c
LDADD+=	-lblacklist
DPADD+=	${LIBBLACKLIST}

d47 5
a51 2
#LDADD+= ${LIBKRB5_LDADD}
#DPADD+= ${LIBKRB5_DPADD}
@


1.1.1.11
log
@Import NetBSD ftpd as at 20200615

Notable changes since NetBSD-20190129:
- Increase some buffer sizes.
- Rename blacklist to blocklist.
@
text
@d2 1
a2 1
#	from	NetBSD: Makefile,v 1.68 2020/06/15 01:57:31 christos Exp
d16 2
a17 2
LDADD+=	-lblocklist
DPADD+=	${LIBBLOCKLIST}
a42 3
COPTS.ftpd.c += ${GCC_NO_STRINGOP_TRUNCATION}
COPTS.logwtmp.c += ${GCC_NO_STRINGOP_TRUNCATION}

a55 3
COPTS.ftpd.c+=		${GCC_NO_STRINGOP_TRUNCATION} ${GCC_NO_FORMAT_TRUNCATION}
COPTS.logwtmp.c+=	${GCC_NO_STRINGOP_TRUNCATION}

@


1.1.1.12
log
@Import NetBSD-ftpd 20230922

Notable changes since import tag NetBSD-20200615:
- Treat failed chdir/chroot for guest and chroot accounts as fatal.
  Also treat failed set{e,}(u,g}id calls as fatal.
  Addresses CVE-2020-7468, via FreeBSD.
- Improve seteuid error handling, per suggestion by Simon Josefsson.
- Add missing check_login checks for MLST and MLSD.
@
text
@d2 1
a2 1
#	from	NetBSD: Makefile,v 1.69 2023/06/03 09:09:11 lukem Exp
d43 2
a44 2
COPTS.ftpd.c += ${CC_WNO_STRINGOP_TRUNCATION}
COPTS.logwtmp.c += ${CC_WNO_STRINGOP_TRUNCATION}
d59 2
a60 2
COPTS.ftpd.c+=		${CC_WNO_STRINGOP_TRUNCATION} ${CC_WNO_FORMAT_TRUNCATION}
COPTS.logwtmp.c+=	${CC_WNO_STRINGOP_TRUNCATION}
@


