net: remove wu-ftpd

old insecure version (~2005), fails to build, and upstream is gone

plenty of other ftp daemons still exist
This commit is contained in:
nia 2020-05-25 11:55:51 +00:00
parent 2a9b773a46
commit af4bd45865
23 changed files with 1 additions and 860 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1333 2020/05/21 07:33:33 jnemeth Exp $
# $NetBSD: Makefile,v 1.1334 2020/05/25 11:55:51 nia Exp $
#
COMMENT= Networking tools
@ -965,7 +965,6 @@ SUBDIR+= wmpload
SUBDIR+= wol
SUBDIR+= wpa_gui
SUBDIR+= wpa_supplicant
SUBDIR+= wu-ftpd
SUBDIR+= x2vnc
SUBDIR+= xfce4-wavelan-plugin
SUBDIR+= xipdump

View file

@ -1,24 +0,0 @@
The package is linked dynamic so that you will get the right crypt
library. If you are serious about performance, you may want to recompile
it by yourself (the port will link static by default).
-Satoshi (Nov 14, 1995)
REMINDER: to use ftpaccess(5) you need to specify -a in command line,
it is changed from previous versions.
-Ache
---
WASHINGTON UNIVERSITY FTP SERVER, RELEASE 2.4
wu-ftpd is a replacement ftp server for Un*x systems. Besides
supporting the ftp protocol defined in RFC 959, it adds the following
features:
o logging of transfers
o logging of commands
o on the fly compression and archiving
o classification of users on type and location
o per class limits
o per directory upload permissions
o restricted guest accounts
o system wide and per directory messages.
o directory alias
o cdpath
o filename filter

View file

@ -1,39 +0,0 @@
# $NetBSD: Makefile,v 1.46 2019/11/03 11:45:58 rillig Exp $
DISTNAME= wu-ftpd-2.6.2
PKGREVISION= 3
CATEGORIES= net
MASTER_SITES= ftp://ftp.nl.uu.net/pub/unix/ftp/wu-ftpd/
MASTER_SITES+= ftp://ftp.u-aizu.ac.jp/pub/net/ftpd/wu-ftpd/wu-ftpd.org/wu-ftpd/
PATCHFILES= realpath.patch connect-dos.patch
#PATCH_SITES= ftp://ftp.sunet.se/pub/nir/ftp/servers/wuarchive-ftpd/wu-ftpd/patches/apply_to_2.6.2/
MAINTAINER= pkgsrc-users@NetBSD.org
#HOMEPAGE= http://www.wu-ftpd.org/
COMMENT= Replacement ftp server for Un*x systems
CONFLICTS= wu-ftpd-vr-[0-9]*
CONFLICTS+= beroftpd-[0-9]*
CONFLICTS+= kth-krb4-[0-9]*
CONFLICTS+= lukemftpd-[0-9]*
GNU_CONFIGURE= YES
USE_TOOLS+= yacc
CONFIGURE_ARGS+= --enable-quota --enable-noop --enable-skey
DIST_SUBDIR= wu-ftpd
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "NetBSD" && make(do-configure)
CFLAGS+= -DHAVE_SYS_MOUNT
.endif
MAKE_ENV+= INSTALL=${INSTALL:Q}
MAKE_ENV+= INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}
MAKE_ENV+= INSTALL_DATA=${INSTALL_DATA:Q}
MAKE_ENV+= INSTALL_MAN=${INSTALL_MAN:Q}
.include "../../mk/bsd.pkg.mk"

View file

@ -1,22 +0,0 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/14 18:09:48 joerg Exp $
bin/ftpcount
bin/ftpwho
libexec/ftpd
man/man1/ftpcount.1
man/man1/ftpwho.1
man/man5/ftpaccess.5
man/man5/ftpconversions.5
man/man5/ftphosts.5
man/man5/ftpservers.5
man/man5/xferlog.5
man/man8/ftpd.8
man/man8/ftprestart.8
man/man8/ftpshut.8
man/man8/privatepw.8
sbin/ftpckconfig
sbin/ftprestart
sbin/ftpshut
sbin/privatepw
share/examples/wu-ftpd/ftpaccess.example
share/examples/wu-ftpd/ftpconversions.example
share/examples/wu-ftpd/ftpusers.example

View file

@ -1,32 +0,0 @@
$NetBSD: distinfo,v 1.21 2015/11/04 00:35:45 agc Exp $
SHA1 (wu-ftpd/wu-ftpd-2.6.2.tar.gz) = e39112bd8a67f189b6a8da8dd81ceb00a910e271
RMD160 (wu-ftpd/wu-ftpd-2.6.2.tar.gz) = 0b7451c185f80cf9a345f97b9642853e0323e3bd
SHA512 (wu-ftpd/wu-ftpd-2.6.2.tar.gz) = d61897489e9829ac3edf7496f721fb28039f648d94f8f87df7112f22d7154dc42230e9febf47c8a82a1c5d68717bfbb7b8cc8835c27a9f9c926644a2e23af093
Size (wu-ftpd/wu-ftpd-2.6.2.tar.gz) = 354784 bytes
SHA1 (wu-ftpd/realpath.patch) = a935197d880ab1ed4320e57e4790811df82e825e
RMD160 (wu-ftpd/realpath.patch) = f96c4c6a8739746ddfe56347dbb10351544a6a2f
SHA512 (wu-ftpd/realpath.patch) = b03b5cdd70681b00e71c9ac160dd4a5b6207e53e70e6cdd42a2eba03ba0c12e8fd325b2f3a3e1c3f780978ea675dfd4d3f733c00960251b3efb541d40174c1d3
Size (wu-ftpd/realpath.patch) = 533 bytes
SHA1 (wu-ftpd/connect-dos.patch) = 8d1131ee3d1bdcb780552ea2d32816989793ae0b
RMD160 (wu-ftpd/connect-dos.patch) = 197994b4af91fd1a6c951b245313598eaa99e398
SHA512 (wu-ftpd/connect-dos.patch) = d8d983a9c99f82a2e166f1ac333519da4b6e356a2d7982280744ad1991a507adff56d3de0e9209882fd594d1f86e6342d68ecfa2bf2631f9dea76e9e1e8bab04
Size (wu-ftpd/connect-dos.patch) = 2307 bytes
SHA1 (patch-aa) = 0e11b95eb9ce697d48d3665d3bb5dc903b67d89b
SHA1 (patch-ab) = cd2f3f74508c2bd379a64b7ddebbd73015be7662
SHA1 (patch-ac) = b5f6142045bb092e7dc6b1420d17c15d594d9350
SHA1 (patch-ad) = 3aafdad6da3ae50272d78c605f3bc2285b0ea085
SHA1 (patch-ae) = 9abb285c65bb3a764a838f22ee9bdc34371265e4
SHA1 (patch-af) = 6f9fe289ea5af19ba4c85f63109e8e47e5b21bca
SHA1 (patch-ag) = 59cc211f4770e5e447b2cd9ca7bd5ab3dc07fc3d
SHA1 (patch-ah) = a5305d6b9f8d3e1145e6951eaf37f0cdd5c98edc
SHA1 (patch-ai) = c5b95222c0c82ede156b1795153a920546fec345
SHA1 (patch-aj) = cce631c7b6c529de803c114e545dfb1f57aea258
SHA1 (patch-ak) = 8eca121c737498106a5e829cb166746436a87237
SHA1 (patch-al) = b537901ac9e267a13247547d621215acd6595502
SHA1 (patch-am) = 1b1cdf067382fce0cb6aa5e6ff605c15414b26ff
SHA1 (patch-an) = fd1d50bd28b283df717c1ce5fe2f0d6f3eab4967
SHA1 (patch-ao) = d64d90ec6d9b3cea66cdfe82e879c7d314551911
SHA1 (patch-ap) = 993e4dd93b9ff56aac43d3472bca01ae2f890b26
SHA1 (patch-configure_in) = 98cfb7718201651f7c6d7219c997bd853148435a
SHA1 (patch-src_logwtmp_c) = c52a7950793dfed5a474e0d09a90bfc105a6dd4a

View file

@ -1,13 +0,0 @@
$NetBSD: patch-aa,v 1.6 1999/12/27 12:13:06 rh Exp $
--- makefiles/Makefile.nbs.orig Mon Dec 27 10:43:57 1999
+++ makefiles/Makefile.nbs Mon Dec 27 10:47:06 1999
@@ -24,7 +24,7 @@
#
DESTDIR=
-PREFIX= /usr/local
+PREFIX?= /usr/pkg
BINDIR= ${DESTDIR}${PREFIX}/bin
BINOWN= bin

View file

@ -1,53 +0,0 @@
$NetBSD: patch-ab,v 1.9 2010/02/14 21:36:20 joerg Exp $
--- Makefile.in.orig 2000-07-01 17:42:15.000000000 +0000
+++ Makefile.in
@@ -67,25 +67,28 @@ install: all
-@mkdir -p $(DESTDIR)/$(mandir)/man1
-@mkdir -p $(DESTDIR)/$(mandir)/man5
-@mkdir -p $(DESTDIR)/@ETCDIR@
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 bin/ftpd $(DESTDIR)/@sbindir@/in.ftpd
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 bin/ftpshut $(DESTDIR)/@sbindir@/ftpshut
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 bin/ftpcount $(DESTDIR)/@bindir@/ftpcount
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 bin/ftpwho $(DESTDIR)/@bindir@/ftpwho
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 bin/ckconfig $(DESTDIR)/@sbindir@/ckconfig
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 bin/ftprestart $(DESTDIR)/@sbindir@/ftprestart
- @INSTALL_PROGRAM@ -o bin -g bin -m 755 util/privatepw/privatepw $(DESTDIR)/@sbindir@/privatepw
+ -@mkdir -p $(DESTDIR)/@libexecdir@
+ -@mkdir -p $(DESTDIR)/@datadir@/examples/wu-ftpd
+ @INSTALL_PROGRAM@ bin/ftpd $(DESTDIR)/@libexecdir@/ftpd
+ @INSTALL_PROGRAM@ bin/ftpshut $(DESTDIR)/@sbindir@/ftpshut
+ @INSTALL_PROGRAM@ bin/ftpcount $(DESTDIR)/@bindir@/ftpcount
+ @INSTALL_PROGRAM@ bin/ftpwho $(DESTDIR)/@bindir@/ftpwho
+ @INSTALL_PROGRAM@ bin/ckconfig $(DESTDIR)/@sbindir@/ftpckconfig
+ @INSTALL_PROGRAM@ bin/ftprestart $(DESTDIR)/@sbindir@/ftprestart
+ @INSTALL_PROGRAM@ util/privatepw/privatepw $(DESTDIR)/@sbindir@/privatepw
@echo installing manpages.
-@mkdir -p $(mandir)
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpd.8 $(DESTDIR)/$(mandir)/man8/ftpd.8
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpcount.1 $(DESTDIR)/$(mandir)/man1/ftpcount.1
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpwho.1 $(DESTDIR)/$(mandir)/man1/ftpwho.1
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpshut.8 $(DESTDIR)/$(mandir)/man8/ftpshut.8
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpaccess.5 $(DESTDIR)/$(mandir)/man5/ftpaccess.5
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftphosts.5 $(DESTDIR)/$(mandir)/man5/ftphosts.5
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpconversions.5 $(DESTDIR)/$(mandir)/man5/ftpconversions.5
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftpservers.5 $(DESTDIR)/$(mandir)/man5/ftpservers.5
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/xferlog.5 $(DESTDIR)/$(mandir)/man5/xferlog.5
- @INSTALL_DATA@ -o bin -g bin -m 644 doc/ftprestart.8 $(DESTDIR)/$(mandir)/man8/ftprestart.8
- @INSTALL_DATA@ -o bin -g bin -m 644 util/privatepw/privatepw.8 $(DESTDIR)/$(mandir)/man8/privatepw.8
- @if test ! -f $(DESTDIR)/@ETCDIR@/ftpaccess; then echo "Since you didn't have a ftpaccess file, the sample has been"; echo "installed to $(DESTDIR)/@ETCDIR@/ftpaccess."; echo "You will probably want to edit it."; @INSTALL@ -c -o bin -g bin -m 644 doc/examples/ftpaccess $(DESTDIR)/@ETCDIR@/ftpaccess; fi
- @if test ! -f $(DESTDIR)/@ETCDIR@/ftpconversions; then echo "Since you didn't have a ftpconversions file, the sample has been"; echo "installed to $(DESTDIR)/@ETCDIR@/ftpconversions."; echo "You will probably want to edit it."; @INSTALL@ -c -o bin -g bin -m 644 doc/examples/ftpconversions $(DESTDIR)/@ETCDIR@/ftpconversions; fi
+ @INSTALL_DATA@ doc/ftpd.8 $(DESTDIR)/$(mandir)/man8/ftpd.8
+ @INSTALL_DATA@ doc/ftpcount.1 $(DESTDIR)/$(mandir)/man1/ftpcount.1
+ @INSTALL_DATA@ doc/ftpwho.1 $(DESTDIR)/$(mandir)/man1/ftpwho.1
+ @INSTALL_DATA@ doc/ftpshut.8 $(DESTDIR)/$(mandir)/man8/ftpshut.8
+ @INSTALL_DATA@ doc/ftpaccess.5 $(DESTDIR)/$(mandir)/man5/ftpaccess.5
+ @INSTALL_DATA@ doc/ftphosts.5 $(DESTDIR)/$(mandir)/man5/ftphosts.5
+ @INSTALL_DATA@ doc/ftpconversions.5 $(DESTDIR)/$(mandir)/man5/ftpconversions.5
+ @INSTALL_DATA@ doc/ftpservers.5 $(DESTDIR)/$(mandir)/man5/ftpservers.5
+ @INSTALL_DATA@ doc/xferlog.5 $(DESTDIR)/$(mandir)/man5/xferlog.5
+ @INSTALL_DATA@ doc/ftprestart.8 $(DESTDIR)/$(mandir)/man8/ftprestart.8
+ @INSTALL_DATA@ util/privatepw/privatepw.8 $(DESTDIR)/$(mandir)/man8/privatepw.8
+ @INSTALL_DATA@ -c doc/examples/ftpaccess $(DESTDIR)/@datadir@/examples/wu-ftpd/ftpaccess.example
+ @INSTALL_DATA@ -c doc/examples/ftpconversions $(DESTDIR)/@datadir@/examples/wu-ftpd/ftpconversions.example
+ @INSTALL_DATA@ -c doc/examples/ftpusers $(DESTDIR)/@datadir@/examples/wu-ftpd/ftpusers.example

View file

@ -1,19 +0,0 @@
$NetBSD: patch-ac,v 1.4 1999/02/13 09:05:02 rh Exp $
--- doc/examples/ftpconversions.orig Fri Apr 1 21:03:23 1994
+++ doc/examples/ftpconversions Sat Feb 13 00:18:05 1999
@@ -1,7 +1,7 @@
- :.Z: : :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
- : : :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
- :.gz: : :/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
- : : :.gz:/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP
- : : :.tar:/bin/tar -c -f - %s:T_REG|T_DIR:O_TAR:TAR
- : : :.tar.Z:/bin/tar -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
- : : :.tar.gz:/bin/tar -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP
+ :.Z: : :/usr/bin/gzip -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
+ : : :.Z:/usr/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
+ :.gz: : :/usr/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
+ : : :.gz:/usr/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP
+ : : :.tar:/usr/bin/tar -c -f - %s:T_REG|T_DIR:O_TAR:TAR
+ : : :.tar.Z:/usr/bin/tar -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
+ : : :.tar.gz:/usr/bin/tar -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP

View file

@ -1,27 +0,0 @@
$NetBSD: patch-ad,v 1.3 1999/02/13 09:05:02 rh Exp $
--- doc/examples/ftpusers.orig Fri Apr 1 21:03:23 1994
+++ doc/examples/ftpusers Sat Feb 13 00:18:05 1999
@@ -1,14 +1,12 @@
root
-bin
-boot
+toor
daemon
-digital
-field
-gateway
-guest
-nobody
operator
-ris
-sccs
-sys
+bin
+games
+news
+man
uucp
+xten
+ingres
+nobody

View file

@ -1,16 +0,0 @@
$NetBSD: patch-ae,v 1.8 2004/09/12 21:34:21 kristerw Exp $
--- support/strcasestr.c.orig 2000-07-01 19:36:29.000000000 +0100
+++ support/strcasestr.c 2004-09-08 16:25:25.000000000 +0100
@@ -25,4 +25,7 @@
****************************************************************************/
+#include "../src/config.h"
+
+#ifndef HAVE_STRCASESTR
#include <string.h>
/*
@@ -46,2 +49,3 @@
return ((char *) s);
}
+#endif

View file

@ -1,13 +0,0 @@
$NetBSD: patch-af,v 1.4 1999/12/27 12:13:07 rh Exp $
--- support/makefiles/Makefile.nbs.orig Mon Oct 4 15:44:08 1999
+++ support/makefiles/Makefile.nbs Mon Dec 27 11:03:06 1999
@@ -33,7 +33,7 @@
LIBC = /usr/lib/libc.a
IFLAGS =
LFLAGS =
-CFLAGS = -O ${IFLAGS} ${LFLAGS}
+CFLAGS+= ${IFLAGS} ${LFLAGS}
SRCS = strcasestr.c authuser.c ftw.c
OBJS = strcasestr.o authuser.o ftw.o

View file

@ -1,13 +0,0 @@
$NetBSD: patch-ag,v 1.6 1999/12/27 12:13:07 rh Exp $
--- src/makefiles/Makefile.nbs.orig Mon Aug 30 20:55:26 1999
+++ src/makefiles/Makefile.nbs Mon Dec 27 11:04:06 1999
@@ -30,7 +30,7 @@
CC = cc -g
IFLAGS = -I.. -I../support
LFLAGS = -L../support
-CFLAGS = -O ${IFLAGS} ${LFLAGS}
+CFLAGS += ${IFLAGS} ${LFLAGS}
XOBJS =
LIBES = ${LSKEY} -lsupport -lcrypt -lresolv
LIBC = /usr/lib/libc.a

View file

@ -1,20 +0,0 @@
$NetBSD: patch-ah,v 1.6 2004/09/08 15:28:39 sketch Exp $
--- src/proto.h.orig 2000-07-01 19:17:39.000000000 +0100
+++ src/proto.h 2004-09-08 16:25:25.000000000 +0100
@@ -25,4 +25,6 @@
****************************************************************************/
+#include "config.h"
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -290,6 +292,8 @@
void endusershell(void);
+#ifndef HAVE_STRCASESTR
/*
** support/strcasestr.c
*/
char *strcasestr(register char *s, register char *find);
+#endif

View file

@ -1,128 +0,0 @@
$NetBSD: patch-ai,v 1.11 2012/04/08 04:43:51 dholland Exp $
- support netbsd-6 libquota
- avoid build failure on netbsd 5.99 proplib quotas
- support dragonfly quotas
- support 4.4BSD quotas
- don't declare own errno
- prune remote hostnames longer than UT_HOSTSIZE from utmp.h
- use va_list correctly
- use snprintf
--- src/ftpd.c.orig 2012-04-08 04:32:17.000000000 +0000
+++ src/ftpd.c
@@ -75,6 +75,7 @@
#include <grp.h>
#endif
#include <sys/stat.h>
+#include <utmp.h>
#define VA_LOCAL_DECL va_list ap;
#define VA_START(f) va_start(ap, f)
@@ -82,12 +83,29 @@
#include "proto.h"
+#ifdef HAVE_QUOTA_H
+#define HAVE_NETBSD_LIBQUOTA
+#include <quota.h>
+#endif
+
#ifdef HAVE_UFS_QUOTA_H
#include <ufs/quota.h>
#endif
+
+#if defined(__DragonFly__) && __DragonFly_version >= 160000
+#define dqblk ufs_dqblk
+#endif
+
#ifdef HAVE_SYS_FS_UFS_QUOTA_H
#include <sys/fs/ufs_quota.h>
#endif
+#ifdef HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#ifdef UFS_QUOTA_ENTRY_NAMES
+/* netbsd 5.99 proplib quota interface (march 2011-january 2012) - punt */
+#undef QUOTA
+#endif
+#endif
#ifdef HAVE_SYS_SYSLOG_H
#include <sys/syslog.h>
@@ -214,7 +232,6 @@ int Send(FILE *sockfp, char *format,...)
/* File containing login names NOT to be used on this machine. Commonly used
* to disallow uucp. */
-extern int errno;
extern int pidfd;
extern char *ctime(const time_t *);
@@ -254,8 +271,10 @@ extern int virtual_ftpaccess;
#endif
#ifdef QUOTA
+#ifndef HAVE_NETBSD_LIBQUOTA
extern struct dqblk quota;
#endif
+#endif
int data;
jmp_buf errcatch;
@@ -2370,7 +2389,8 @@ void end_login(void)
(void) seteuid((uid_t) 0);
if (logged_in)
if (wtmp_logging)
- wu_logwtmp(ttyline, pw->pw_name, remotehost, 0);
+ wu_logwtmp(ttyline, pw->pw_name, strlen(remotehost) > UT_HOSTSIZE
+ ? remoteaddr : remotehost, 0);
pw = NULL;
#ifdef AFS_AUTH
ktc_ForgetAllTokens();
@@ -2869,14 +2889,18 @@ void pass(char *passwd)
#ifdef DEBUG
syslog(LOG_DEBUG, "about to call wtmp");
#endif
- wu_logwtmp(ttyline, pw->pw_name, remotehost, 1);
+ wu_logwtmp(ttyline, pw->pw_name, strlen(remotehost) > UT_HOSTSIZE
+ ? remoteaddr : remotehost, 1);
}
logged_in = 1;
expand_id();
#ifdef QUOTA
+#ifndef HAVE_NETBSD_LIBQUOTA
+ /* the code for the libquota case clears the quotas for us on failure */
memset(&quota, 0, sizeof(quota));
+#endif
get_quota(pw->pw_dir, pw->pw_uid);
#endif
@@ -5459,7 +5483,9 @@ void reply(int n, char *fmt,...)
*p = '\0';
/* send a line...(note that this overrides dolreplies!) */
+ VA_START(fmt);
vreply(USE_REPLY_LONG | USE_REPLY_NOTFMT, n, ptr, ap);
+ VA_END; /* *NEVER* send a 0 as an ap, some machines use a *struct* for a va_list! */
if (p)
ptr = p + 1; /* set to the next line... (\0 is handled in the while) */
@@ -6083,6 +6109,8 @@ void dologout(int status)
(void) seteuid((uid_t) 0);
if (wtmp_logging)
wu_logwtmp(ttyline, pw->pw_name, remotehost, 0);
+ wu_logwtmp(ttyline, pw->pw_name, strlen(remotehost) > UT_HOSTSIZE
+ ? remoteaddr : remotehost, 0);
}
if (logging)
syslog(LOG_INFO, "FTP session closed");
@@ -7378,7 +7406,7 @@ int SockPrintf(FILE *sockfp, char *forma
char buf[32768];
va_start(ap, format);
- vsprintf(buf, format, ap);
+ vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
return SockWrite(buf, 1, strlen(buf), sockfp);
}

View file

@ -1,23 +0,0 @@
$NetBSD: patch-aj,v 1.8 2012/04/08 04:49:56 dholland Exp $
- check for <quota.h>
- check for strcasestr()
--- src/config.h.in.orig 2000-07-01 18:04:21.000000000 +0000
+++ src/config.h.in
@@ -42,6 +42,7 @@
#undef HAVE_STRING_H
#undef HAVE_SYS_DIR_H
#undef HAVE_SYS_NDIR_H
+#undef HAVE_QUOTA_H
#undef HAVE_SYS_QUOTA_H
#undef HAVE_SYS_FS_UFS_QUOTA_H
#undef HAVE_UFS_QUOTA_H
@@ -76,6 +77,7 @@
#undef HAVE_REGEXEC
#undef HAVE_SETSID
#undef HAVE_MEMMOVE
+#undef HAVE_STRCASESTR
#undef HAVE_STRTOUL
#undef HAVE_SIGLIST
#undef FACILITY

View file

@ -1,21 +0,0 @@
$NetBSD: patch-ak,v 1.5 2005/12/18 18:54:26 joerg Exp $
--- src/glob.c.orig 2001-11-29 17:01:38.000000000 +0000
+++ src/glob.c
@@ -88,7 +88,6 @@ char **blkcpy(char **, register char **)
char *globerr;
char *home;
-extern int errno;
static int globcnt;
@@ -437,6 +436,8 @@ static int amatch(char *s, char *p)
continue;
case '*':
+ while (*p == '*')
+ p++;
if (!*p)
return (1);
if (*p == '/') {

View file

@ -1,12 +0,0 @@
$NetBSD: patch-al,v 1.7 2005/12/18 18:54:26 joerg Exp $
--- support/ftw.c.orig 2005-12-18 18:43:08.000000000 +0000
+++ support/ftw.c
@@ -55,7 +55,6 @@
(dp->d_name[0] == '.' && (!dp->d_name[1] || \
(dp->d_name[1] == '.' && !dp->d_name[2])))
-extern int errno;
static int g_fds, (*g_fn) (), g_opts;
static char *bp;

View file

@ -1,12 +0,0 @@
$NetBSD: patch-am,v 1.6 2005/12/18 18:54:26 joerg Exp $
--- src/ftpcmd.y.orig 2005-12-18 18:44:25.000000000 +0000
+++ src/ftpcmd.y
@@ -87,7 +87,6 @@ extern int usedefault;
extern int transflag;
extern char tmpline[];
extern int data;
-extern int errno;
extern char *home;
off_t restart_point;

View file

@ -1,12 +0,0 @@
$NetBSD: patch-an,v 1.4 2005/12/18 18:54:26 joerg Exp $
--- src/routevector.c.orig 2005-12-18 18:48:05.000000000 +0000
+++ src/routevector.c
@@ -88,7 +88,6 @@ extern char hostname[], remotehost[];
extern int usedefault;
extern int transflag;
extern int data;
-extern int errno;
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif

View file

@ -1,45 +0,0 @@
$NetBSD: patch-ao,v 1.3 2012/04/08 05:11:13 dholland Exp $
- support netbsd-6 libquota API
- support dragonfly quotas
caution: the dragonfly patch isn't in the configure.in patch; don't regen
this patch without thinking.
--- configure.orig 2001-11-29 23:54:27.000000000 +0000
+++ configure
@@ -5223,7 +5223,7 @@ EOF
fi
if test $quota != no; then
-for ac_header in sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h
+for ac_header in quota.h sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:5229: checking for $ac_header" >&5
@@ -5271,8 +5271,11 @@ EOF
fi
done
- if test $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
+ if test $ac_cv_header_quota.h = yes -o $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
quota=yes
+ if test $ac_cv_header_quota_h = yes; then
+ LIBS="$LIBS -lquota"
+ fi
else
if test $quota = yes; then
{ echo "$as_me:5278: WARNING: QUOTA not supported by OS - disabled" >&5
@@ -5333,6 +5336,12 @@ echo $ECHO_N "checking whether quota sup
#ifdef HAVE_UFS_UFS_QUOTA_H
#include <ufs/ufs/quota.h>
#endif
+#if defined(__DragonFly__)
+# include <sys/param.h>
+# if __DragonFly_version >= 160000
+# define dqblk ufs_dqblk
+# endif
+#endif
struct dqblk quota;
int
main ()

View file

@ -1,256 +0,0 @@
$NetBSD: patch-ap,v 1.3 2012/04/08 05:11:13 dholland Exp $
- support netbsd-6 libquota API
- avoid build failure on netbsd 5.99 proplib quotas
- support dragonfly quotas
--- src/extensions.c.orig 2000-07-01 18:17:38.000000000 +0000
+++ src/extensions.c
@@ -55,7 +55,9 @@
#include <sys/file.h>
#include <sys/param.h>
-#ifdef HAVE_SYS_FS_UFS_QUOTA_H
+#if defined(HAVE_QUOTA_H)
+#include <quota.h>
+#elif defined(HAVE_SYS_FS_UFS_QUOTA_H)
#include <sys/fs/ufs_quota.h>
#elif defined(HAVE_UFS_UFS_QUOTA_H)
#include <ufs/ufs/quota.h>
@@ -67,6 +69,15 @@
#include <sys/mnttab.h>
#endif
+#ifdef HAVE_QUOTA_H
+/* NetBSD quota_open() API and library */
+#define HAVE_NETBSD_LIBQUOTA
+#endif
+
+#if defined(__DragonFly__) && __DragonFly_version >= 160000
+#define dqblk ufs_dqblk
+#endif
+
#if defined(HAVE_STATVFS)
#include <sys/statvfs.h>
#elif defined(HAVE_SYS_VFS)
@@ -91,8 +102,18 @@
#include "support/ftw.h"
#endif
+#if defined(HAVE_UFS_UFS_QUOTA_H) && defined(UFS_QUOTA_ENTRY_NAMES)
+/* netbsd 5.99 proplib quota interface (march 2011-january 2012) - punt */
+#undef QUOTA
+#endif
+
#ifdef QUOTA
+#ifdef HAVE_NETBSD_LIBQUOTA
+#undef QUOTA_DEVICE
+struct quotaval quota_blocks, quota_files;
+#else
struct dqblk quota;
+#endif
char *time_quota(long curstate, long softlimit, long timelimit, char *timeleft);
#endif
@@ -252,6 +272,11 @@ void msg_massage(const char *inbuf, char
char *outptr = outbuf;
#ifdef QUOTA
char timeleft[80];
+#ifdef HAVE_NETBSD_LIBQUOTA
+ uint64_t quotaval;
+#else
+ long quotaval;
+#endif
#endif
char buffer[MAXPATHLEN];
time_t curtime;
@@ -372,67 +397,101 @@ void msg_massage(const char *inbuf, char
#ifdef QUOTA
case 'B':
+#ifdef HAVE_NETBSD_LIBQUOTA
+ quotaval = quota_blocks.qv_hardlimit;
+#else
+ quotaval = quota.dqb_bhardlimit;
+#endif
#ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
snprintf(outptr, outlen, "%ld", quota.dqb_bhardlimit % 2 ?
- (long) (quota.dqb_bhardlimit / 2 + 1) : (long) (quota.dqb_bhardlimit / 2));
+ (quotaval / 2 + 1) : (quotaval / 2));
#else
- snprintf(outptr, outlen, "%ld", (long) quota.dqb_bhardlimit);
+ snprintf(outptr, outlen, "%ld", quotaval);
#endif
break;
case 'b':
+#ifdef HAVE_NETBSD_LIBQUOTA
+ quotaval = quota_blocks.qv_softlimit;
+#else
+ quotaval = quota.dqb_bsoftlimit;
+#endif
#ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
- snprintf(outptr, outlen, "%ld", quota.dqb_bsoftlimit % 2 ?
- (long) (quota.dqb_bsoftlimit / 2 + 1) : (long) (quota.dqb_bsoftlimit / 2));
+ snprintf(outptr, outlen, "%ld", quotaval % 2 ?
+ (quotaval / 2 + 1) : (quotaval / 2));
#else
- snprintf(outptr, outlen, "%ld", (long) quota.dqb_bsoftlimit);
+ snprintf(outptr, outlen, "%ld", quotaval);
#endif
break;
case 'Q':
+#ifdef HAVE_NETBSD_LIBQUOTA
+ quotaval = quota_blocks.qv_usage;
+#else
+ quotaval = quota.dqb_curblocks;
+#endif
#ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
- snprintf(outptr, outlen, "%ld", quota.dqb_curblocks % 2 ?
- (long) (quota.dqb_curblocks / 2 + 1) : (long) (quota.dqb_curblocks / 2));
+ snprintf(outptr, outlen, "%ld", quotaval % 2 ?
+ (quotaval / 2 + 1) : (quotaval / 2));
#else
- snprintf(outptr, outlen, "%ld", quota.dqb_curblocks);
+ snprintf(outptr, outlen, "%ld", quotaval);
#endif
break;
case 'I':
-#if defined(QUOTA_INODE)
- snprintf(outptr, outlen, "%d", quota.dqb_ihardlimit);
+#ifdef HAVE_NETBSD_LIBQUOTA
+ quotaval = quota_files.qv_hardlimit;
+#elif defined(QUOTA_INODE)
+ quotaval = quota.dqb_ihardlimit;
#else
- snprintf(outptr, outlen, "%ld", (long) quota.dqb_fhardlimit);
+ quotaval = quota.dqb_fhardlimit;
#endif
+ snprintf(outptr, outlen, "%ld", quotaval);
break;
case 'i':
-#if defined(QUOTA_INODE)
- snprintf(outptr, outlen, "%d", quota.dqb_isoftlimit);
+#ifdef HAVE_NETBSD_LIBQUOTA
+ quotaval = quota_files.qv_softlimit;
+#elif defined(QUOTA_INODE)
+ quotaval = quota.dqb_isoftlimit;
#else
- snprintf(outptr, outlen, "%ld", (long) quota.dqb_fsoftlimit);
+ quotaval = quota.dqb_fsoftlimit;
#endif
+ snprintf(outptr, outlen, "%ld", quotaval);
break;
case 'q':
-#if defined(QUOTA_INODE)
- snprintf(outptr, outlen, "%d", quota.dqb_curinodes);
+#ifdef HAVE_NETBSD_LIBQUOTA
+ quotaval = quota_files.qv_usage;
+#elif defined(QUOTA_INODE)
+ quotaval = quota.dqb_curinodes;
#else
- snprintf(outptr, outlen, "%ld", (long) quota.dqb_curfiles);
+ quotaval = quota.dqb_curfiles;
#endif
+ snprintf(outptr, outlen, "%ld", quotaval);
break;
case 'H':
+#ifdef HAVE_NETBSD_LIBQUOTA
+ time_quota(quota_blocks.qv_usage, quota_blocks.qv_softlimit,
+ quota_blocks.qv_expiretime, timeleft);
+#else
time_quota(quota.dqb_curblocks, quota.dqb_bsoftlimit,
#if defined(QUOTA_INODE)
quota.dqb_btime, timeleft);
#else
quota.dqb_btimelimit, timeleft);
#endif
+#endif
strncpy(outptr, timeleft, outlen);
+ outptr[outlen] = 0;
break;
case 'h':
+#ifdef HAVE_NETBSD_LIBQUOTA
+ time_quota(quota_files.qv_usage, quota_files.qv_softlimit,
+ quota_files.qv_expiretime, timeleft);
+#else
#if defined(QUOTA_INODE)
time_quota(quota.dqb_curinodes, quota.dqb_isoftlimit,
quota.dqb_itime, timeleft);
@@ -440,7 +499,9 @@ void msg_massage(const char *inbuf, char
time_quota(quota.dqb_curfiles, quota.dqb_fsoftlimit,
quota.dqb_ftimelimit, timeleft);
#endif
+#endif
strncpy(outptr, timeleft, outlen);
+ outptr[outlen] = 0;
break;
#endif /* QUOTA */
@@ -1888,12 +1949,35 @@ int path_to_device(char *pathname, char
}
return 1;
}
-#endif
+#endif /* QUOTA_DEVICE */
void get_quota(char *fs, int uid)
{
char mnt_fsname[MNTMAXSTR];
-#ifdef HAS_NO_QUOTACTL
+
+#if defined(HAVE_NETBSD_LIBQUOTA)
+ struct quotahandle *qh;
+ struct quotakey qk;
+
+ qh = quota_open(fs);
+ if (qh == NULL) {
+ quotaval_clear(&quota_blocks);
+ quotaval_clear(&quota_files);
+ return;
+ }
+ qk.qk_idtype = QUOTA_IDTYPE_USER;
+ qk.qk_id = uid;
+ qk.qk_objtype = QUOTA_OBJTYPE_BLOCKS;
+ if (quota_get(qh, &qk, &quota_blocks)) {
+ quotaval_clear(&quota_blocks);
+ }
+ qk.qk_objtype = QUOTA_OBJTYPE_FILES;
+ if (quota_get(qh, &qk, &quota_files)) {
+ quotaval_clear(&quota_files);
+ }
+ quota_close(qh);
+
+#elif defined(HAS_NO_QUOTACTL)
int dirfd;
struct quotctl qp;
@@ -1905,19 +1989,18 @@ void get_quota(char *fs, int uid)
ioctl(dirfd, Q_QUOTACTL, &qp);
close(dirfd);
}
-#else
-#ifdef QUOTA_DEVICE
+#elif defined(QUOTA_DEVICE)
if (path_to_device(fs, mnt_fsname))
#ifdef QCMD
quotactl(QCMD(Q_GETQUOTA, USRQUOTA), mnt_fsname, uid, (char *) &quota);
#else
quotactl(Q_GETQUOTA, mnt_fsname, uid, (char *) &quota);
#endif
-#else
+
+#else /* base case */
quotactl(fs, QCMD(Q_GETQUOTA, USRQUOTA), uid, (char *) &quota);
#endif
-#endif /* HAS_NO_QUOTACTL */
}
char *time_quota(long curstate, long softlimit, long timelimit, char *timeleft)

View file

@ -1,24 +0,0 @@
$NetBSD: patch-configure_in,v 1.2 2012/04/08 05:11:13 dholland Exp $
- support netbsd-6 libquota API.
caution: there's a dragonfly patch to configure in patch-ao that isn't
reflected here. don't regen that from this without thinking.
--- configure.in.orig 2001-11-29 17:10:58.000000000 +0000
+++ configure.in
@@ -739,9 +739,12 @@ if test $paranoid = yes; then
AC_DEFINE(PARANOID)
fi
if test $quota != no; then
- AC_CHECK_HEADERS(sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h)
- if test $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
+ AC_CHECK_HEADERS(quota.h sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h)
+ if test $ac_cv_header_quota.h = yes -o $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
quota=yes
+ if test $ac_cv_header_quota_h = yes; then
+ LIBS="$LIBS -lquota"
+ fi
else
if test $quota = yes; then
AC_MSG_WARN(QUOTA not supported by OS - disabled)

View file

@ -1,34 +0,0 @@
$NetBSD: patch-src_logwtmp_c,v 1.1 2011/12/19 05:06:34 dholland Exp $
Use time_t for calls to time().
--- src/logwtmp.c~ 2000-07-01 18:17:39.000000000 +0000
+++ src/logwtmp.c
@@ -81,6 +81,7 @@ void wu_logwtmp(char *line, char *name,
{
struct stat buf;
struct utmp ut;
+ time_t timer;
#ifdef SVR4
#ifndef NO_UTMPX
@@ -120,7 +121,8 @@ void wu_logwtmp(char *line, char *name,
(void) strncpy(utx.ut_line, line, sizeof(utx.ut_line));
utx.ut_syslen = strlen(utx.ut_host) + 1;
utx.ut_pid = getpid();
- (void) time(&utx.ut_tv.tv_sec);
+ (void) time(&timer);
+ utx.ut_tv.tv_sec = timer;
if (login /* name && *name */ ) {
utx.ut_type = USER_PROCESS;
}
@@ -192,7 +194,8 @@ void wu_logwtmp(char *line, char *name,
(void) strncpy(ut.ut_host, "", sizeof(ut.ut_host));
}
#endif
- (void) time(&ut.ut_time);
+ (void) time(&timer);
+ ut.ut_time = timer;
if (write(fd, (char *) &ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
(void) ftruncate(fd, buf.st_size);