Date: Thu, 19 Aug 2004 02:48:10 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 60031 for review Message-ID: <200408190248.i7J2mAg8008598@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=60031 Change 60031 by peter@peter_daintree on 2004/08/19 02:47:49 IFC @60030 Affected files ... .. //depot/projects/hammer/Makefile#23 integrate .. //depot/projects/hammer/Makefile.inc1#57 integrate .. //depot/projects/hammer/contrib/lukemftpd/libnetbsd/strsuftoll.c#2 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/Makefile#2 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/cmds.c#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/conf.c#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/extern.h#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/ftpcmd.y#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/ftpd.8#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/ftpd.c#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/ftpd.conf.5#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/ftpusers.5#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/logutmp.c#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/logwtmp.c#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/pathnames.h#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/popen.c#3 integrate .. //depot/projects/hammer/contrib/lukemftpd/src/version.h#3 integrate .. //depot/projects/hammer/etc/rc.d/gbde_swap#3 integrate .. //depot/projects/hammer/gnu/usr.bin/cc/cc_tools/Makefile#18 integrate .. //depot/projects/hammer/lib/csu/ia64/crt1.S#3 integrate .. //depot/projects/hammer/lib/libc/gen/tls.c#2 integrate .. //depot/projects/hammer/lib/libc/stdlib/malloc.3#3 integrate .. //depot/projects/hammer/libexec/lukemftpd/Makefile#9 integrate .. //depot/projects/hammer/release/Makefile#52 integrate .. //depot/projects/hammer/release/powerpc/boot.tbxi#1 branch .. //depot/projects/hammer/release/powerpc/boot_crunch.conf#1 branch .. //depot/projects/hammer/release/powerpc/hfs.map#1 branch .. //depot/projects/hammer/release/powerpc/mkisoimages.sh#1 branch .. //depot/projects/hammer/release/scripts/doFS.sh#15 integrate .. //depot/projects/hammer/sbin/geom/class/mirror/Makefile#2 integrate .. //depot/projects/hammer/sbin/geom/class/mirror/geom_mirror.c#2 integrate .. //depot/projects/hammer/sbin/geom/class/mirror/gmirror.8#1 branch .. //depot/projects/hammer/sbin/geom/class/raid3/Makefile#2 integrate .. //depot/projects/hammer/sbin/geom/class/raid3/geom_raid3.c#2 integrate .. //depot/projects/hammer/sbin/geom/class/raid3/graid3.8#1 branch .. //depot/projects/hammer/sbin/geom/core/geom.8#5 integrate .. //depot/projects/hammer/share/examples/mdoc/example.4#2 integrate .. //depot/projects/hammer/sys/boot/common/help.common#7 integrate .. //depot/projects/hammer/sys/boot/common/loader.8#14 integrate .. //depot/projects/hammer/sys/boot/powerpc/loader/Makefile#8 integrate .. //depot/projects/hammer/sys/conf/options.pc98#23 integrate .. //depot/projects/hammer/sys/contrib/dev/acpica/aclocal.h#10 integrate .. //depot/projects/hammer/sys/dev/acpica/acpi.c#45 integrate .. //depot/projects/hammer/sys/dev/acpica/acpi_pci_link.c#16 integrate .. //depot/projects/hammer/sys/dev/acpica/acpiio.h#5 integrate .. //depot/projects/hammer/sys/dev/acpica/acpivar.h#33 integrate .. //depot/projects/hammer/sys/dev/aic7xxx/ahc_isa.c#2 integrate .. //depot/projects/hammer/sys/dev/aic7xxx/aic79xx.c#17 integrate .. //depot/projects/hammer/sys/dev/aic7xxx/aic79xx.h#16 integrate .. //depot/projects/hammer/sys/dev/aic7xxx/aic7xxx.h#9 integrate .. //depot/projects/hammer/sys/dev/firewire/if_fwe.c#20 integrate .. //depot/projects/hammer/sys/dev/twa/twa_freebsd.c#7 integrate .. //depot/projects/hammer/sys/dev/twa/twa_reg.h#2 integrate .. //depot/projects/hammer/sys/dev/vx/if_vx.c#14 integrate .. //depot/projects/hammer/sys/dev/vx/if_vx_eisa.c#8 integrate .. //depot/projects/hammer/sys/dev/vx/if_vx_pci.c#8 integrate .. //depot/projects/hammer/sys/dev/vx/if_vxreg.h#3 integrate .. //depot/projects/hammer/sys/dev/vx/if_vxvar.h#3 integrate .. //depot/projects/hammer/sys/geom/geom_slice.c#19 integrate .. //depot/projects/hammer/sys/geom/mirror/g_mirror.c#2 integrate .. //depot/projects/hammer/sys/geom/nop/g_nop.c#5 integrate .. //depot/projects/hammer/sys/geom/raid3/g_raid3.c#2 integrate .. //depot/projects/hammer/sys/geom/vinum/geom_vinum_drive.c#6 integrate .. //depot/projects/hammer/sys/geom/vinum/geom_vinum_init.c#3 integrate .. //depot/projects/hammer/sys/kern/uipc_usrreq.c#23 integrate .. //depot/projects/hammer/sys/modules/Makefile#51 integrate .. //depot/projects/hammer/sys/modules/linprocfs/Makefile#3 integrate .. //depot/projects/hammer/sys/netinet/in_pcb.c#28 integrate .. //depot/projects/hammer/sys/netinet/ip_input.c#36 integrate .. //depot/projects/hammer/sys/netinet/ip_output.c#35 integrate .. //depot/projects/hammer/sys/netinet/udp_usrreq.c#22 integrate .. //depot/projects/hammer/sys/sys/param.h#42 integrate .. //depot/projects/hammer/sys/vm/vnode_pager.c#20 integrate .. //depot/projects/hammer/usr.bin/make/make.1#14 integrate .. //depot/projects/hammer/usr.sbin/acpi/acpiconf/acpiconf.8#9 integrate .. //depot/projects/hammer/usr.sbin/acpi/acpiconf/acpiconf.c#8 integrate .. //depot/projects/hammer/usr.sbin/acpi/acpidump/acpi.c#12 integrate .. //depot/projects/hammer/usr.sbin/acpi/acpidump/acpidump.8#6 integrate Differences ... ==== //depot/projects/hammer/Makefile#23 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile,v 1.306 2004/08/09 11:38:41 harti Exp $ +# $FreeBSD: src/Makefile,v 1.308 2004/08/18 07:17:01 ru Exp $ # # The user-driven targets are: # @@ -85,6 +85,12 @@ PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKEOBJDIRPREFIX?= /usr/obj +_MAKEOBJDIRPREFIX!= env -i PATH=${PATH} MAKEFLAGS="${.MAKEFLAGS}" ${MAKE} \ + -f /dev/null -V MAKEOBJDIRPREFIX dummy +.if !empty(_MAKEOBJDIRPREFIX) +.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ + (in /etc/make.conf) or command-line variable. +.endif MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} BINMAKE= \ `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ @@ -144,10 +150,9 @@ # Set a reasonable default .MAIN: all +STARTTIME!= LC_ALL=C date + .if defined(HISTORICAL_MAKE_WORLD) || defined(DESTDIR) -.if make(world) -STARTTIME!= LC_ALL=C date -.endif # # world # @@ -242,16 +247,20 @@ # universe # # Attempt to rebuild *everything* for all supported architectures, -# with reasonable chance of success, regardless of how old your +# with a reasonable chance of success, regardless of how old your # existing system is. # -i386_mach= pc98 -universe: +universe: universe_prologue +universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @echo "--------------------------------------------------------------" -.for arch in i386 sparc64 alpha ia64 amd64 -.for mach in ${arch} ${${arch}_mach} +.for target in i386 i386:pc98 sparc64 alpha ia64 amd64 +.for arch in ${target:C/:.*$//} +.for mach in ${target:C/^.*://} +universe: universe_${mach} +.ORDER: universe_prologue universe_${mach} universe_epilogue +universe_${mach}: @echo ">> ${mach} started on `LC_ALL=C date`" -cd ${.CURDIR} && ${MAKE} ${JFLAG} buildworld \ TARGET_ARCH=${arch} TARGET=${mach} \ @@ -262,10 +271,13 @@ -cd ${.CURDIR}/sys/${mach}/conf && ${MAKE} LINT \ > ${.CURDIR}/_.${mach}.makeLINT 2>&1 .endif - cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernels TARGET_ARCH=${arch} TARGET=${mach} + cd ${.CURDIR} && ${MAKE} buildkernels TARGET_ARCH=${arch} TARGET=${mach} @echo ">> ${mach} completed on `LC_ALL=C date`" .endfor .endfor +.endfor +universe: universe_epilogue +universe_epilogue: @echo "--------------------------------------------------------------" @echo ">>> make universe completed on `LC_ALL=C date`" @echo " (started ${STARTTIME})" @@ -274,8 +286,6 @@ .if make(buildkernels) KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ find [A-Z]*[A-Z] -type f -maxdepth 0 ! -name NOTES -.endif - buildkernels: .for kernel in ${KERNCONFS} -cd ${.CURDIR} && ${MAKE} ${JFLAG} buildkernel \ @@ -283,3 +293,4 @@ __MAKE_CONF=/dev/null \ > _.${TARGET}.${kernel} 2>&1 .endfor +.endif ==== //depot/projects/hammer/Makefile.inc1#57 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.438 2004/08/16 18:17:14 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.440 2004/08/18 13:21:40 ru Exp $ # # Make command line options: # -DNO_DYNAMICROOT do not link /bin and /sbin dynamically @@ -90,13 +90,6 @@ .endif MAKEOBJDIRPREFIX?= /usr/obj -_MAKEOBJDIRPREFIX!= env -i PATH=${PATH} MAKEFLAGS="${.MAKEFLAGS}" ${MAKE} \ - -f /dev/null -V MAKEOBJDIRPREFIX dummy -.if !empty(_MAKEOBJDIRPREFIX) -.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ - (in /etc/make.conf) or command-line variable. -.endif - .if !defined(OSRELDATE) .if exists(/usr/include/osreldate.h) OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ @@ -788,7 +781,6 @@ bin/csh \ bin/sh \ ${_rescue} \ - gnu/usr.bin/cc/cc_tools \ lib/libncurses \ ${_share} \ ${_aicasm} \ @@ -801,6 +793,7 @@ ${MAKE} DIRPRFX=${_tool}/ build-tools .endfor .for _tool in \ + gnu/usr.bin/cc/cc_tools \ ${_kerberos5_tools} ${_+_}@${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ==== //depot/projects/hammer/contrib/lukemftpd/libnetbsd/strsuftoll.c#2 (text+ko) ==== @@ -1,6 +1,6 @@ -/* $NetBSD: strsuftoll.c,v 1.1 2002/11/29 12:58:17 lukem Exp $ */ +/* $NetBSD: strsuftoll.c,v 1.5 2004/01/17 23:02:51 dbj Exp $ */ /*- - * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. + * Copyright (c) 2001-2002,2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -50,11 +50,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -71,20 +67,20 @@ * SUCH DAMAGE. */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strsuftoll.c,v 1.1 2002/11/29 12:58:17 lukem Exp $"); +__RCSID("$NetBSD: strsuftoll.c,v 1.5 2004/01/17 23:02:51 dbj Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef _LIBC #include "namespace.h" #endif -#if HAVE_CONFIG_H -#include "config.h" -#endif - #if !HAVE_STRSUFTOLL #include <sys/types.h> @@ -100,16 +96,11 @@ #include <string.h> #ifdef _LIBC -# define _STRSUFTOLL _strsuftoll -# define _STRSUFTOLLX _strsuftollx # ifdef __weak_alias __weak_alias(strsuftoll, _strsuftoll) __weak_alias(strsuftollx, _strsuftollx) # endif -#else /* !LIBC */ -# define _STRSUFTOLL strsuftoll -# define _STRSUFTOLLX strsuftollx -#endif /* !LIBC */ +#endif /* LIBC */ /* * Convert an expression of the following forms to a (u)int64_t. @@ -117,8 +108,10 @@ * 2) A positive decimal number followed by a b (mult by 512). * 3) A positive decimal number followed by a k (mult by 1024). * 4) A positive decimal number followed by a m (mult by 1048576). - * 5) A positive decimal number followed by a w (mult by sizeof int) - * 6) Two or more positive decimal numbers (with/without k,b or w). + * 5) A positive decimal number followed by a g (mult by 1073741824). + * 6) A positive decimal number followed by a t (mult by 1099511627776). + * 7) A positive decimal number followed by a w (mult by sizeof int) + * 8) Two or more positive decimal numbers (with/without k,b or w). * separated by x (also * for backwards compatibility), specifying * the product of the indicated values. * Returns the result upon successful conversion, or exits with an @@ -127,7 +120,7 @@ */ /* LONGLONG */ long long -_STRSUFTOLL(const char *desc, const char *val, +strsuftoll(const char *desc, const char *val, long long min, long long max) { long long result; @@ -145,7 +138,7 @@ */ /* LONGLONG */ long long -_STRSUFTOLLX(const char *desc, const char *val, +strsuftollx(const char *desc, const char *val, long long min, long long max, char *ebuf, size_t ebuflen) { long long num, t; @@ -161,7 +154,7 @@ while (isspace((unsigned char)*val)) /* Skip leading space */ val++; - num = strtoll(val, &expr, 0); + num = strtoll(val, &expr, 10); if (errno == ERANGE) goto erange; /* Overflow */ @@ -244,7 +237,7 @@ /* LONGLONG */ snprintf(ebuf, ebuflen, "%s %lld is greater than %lld.", - desc, (long long)num, (long long)min); + desc, (long long)num, (long long)max); return (0); } *ebuf = '\0'; ==== //depot/projects/hammer/contrib/lukemftpd/src/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.49 2002/08/22 00:09:38 christos Exp $ +# $NetBSD: Makefile,v 1.51 2003-07-23 08:01:27 itojun Exp $ # @(#)Makefile 8.2 (Berkeley) 4/4/94 .include <bsd.own.mk> @@ -28,19 +28,24 @@ ftpd.o ftpcmd.o: version.h -# XXX Kerberos support is broken right now. +#.if (${USE_KERBEROS} != "no") +# #.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 +#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 +# #.endif .include <bsd.prog.mk> ==== //depot/projects/hammer/contrib/lukemftpd/src/cmds.c#3 (text+ko) ==== @@ -1,7 +1,7 @@ -/* $NetBSD: cmds.c,v 1.20 2003/01/08 18:07:31 manu Exp $ */ +/* $NetBSD: cmds.c,v 1.23 2004-08-09 12:56:47 lukem Exp $ */ /* - * Copyright (c) 1999-2001 The NetBSD Foundation, Inc. + * Copyright (c) 1999-2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -48,11 +48,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -101,7 +97,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: cmds.c,v 1.20 2003/01/08 18:07:31 manu Exp $"); +__RCSID("$NetBSD: cmds.c,v 1.23 2004-08-09 12:56:47 lukem Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -111,7 +107,6 @@ #include <dirent.h> #include <errno.h> -#include <setjmp.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -812,7 +807,7 @@ mlsname(FILE *fp, factelem *fe) { char realfile[MAXPATHLEN]; - int i, userf; + int i, userf = 0; for (i = 0; i < FACTTABSIZE; i++) { if (facttab[i].enabled) ==== //depot/projects/hammer/contrib/lukemftpd/src/conf.c#3 (text+ko) ==== @@ -1,7 +1,7 @@ -/* $NetBSD: conf.c,v 1.50 2002/11/16 03:10:34 itojun Exp $ */ +/* $NetBSD: conf.c,v 1.52 2004-08-09 12:56:47 lukem Exp $ */ /*- - * Copyright (c) 1997-2001 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: conf.c,v 1.50 2002/11/16 03:10:34 itojun Exp $"); +__RCSID("$NetBSD: conf.c,v 1.52 2004-08-09 12:56:47 lukem Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -51,7 +51,6 @@ #include <fcntl.h> #include <glob.h> #include <netdb.h> -#include <setjmp.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> ==== //depot/projects/hammer/contrib/lukemftpd/src/extern.h#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.44 2002/05/30 00:24:47 enami Exp $ */ +/* $NetBSD: extern.h,v 1.50 2004-08-09 12:56:47 lukem Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -36,7 +32,7 @@ */ /*- - * Copyright (c) 1997-2001 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -147,9 +143,6 @@ void init_curclass(void); void logxfer(const char *, off_t, const char *, const char *, const struct timeval *, const char *); -#if 0 -void logwtmp(const char *, const char *, const char *); -#endif struct tab *lookup(struct tab *, const char *); void makedir(const char *); void mlsd(const char *); @@ -184,6 +177,21 @@ char *xstrdup(const char *); void yyerror(char *); +#ifdef SUPPORT_UTMP +struct utmp; + +void ftpd_logwtmp(const char *, const char *, const char *); +void ftpd_login(const struct utmp *ut); +int ftpd_logout(const char *line); +#endif + +#ifdef SUPPORT_UTMPX +struct utmpx; + +void ftpd_loginx(const struct utmpx *); +void ftpd_logwtmpx(const char *, const char *, const char *, int, int); +#endif + #include <netinet/in.h> #if defined(__NetBSD__) @@ -302,11 +310,10 @@ GLOBAL int connections; GLOBAL struct ftpclass curclass; GLOBAL int debug; -GLOBAL jmp_buf errcatch; GLOBAL char *emailaddr; GLOBAL int form; GLOBAL int gidcount; /* number of entries in gidlist[] */ -GLOBAL gid_t gidlist[NGROUPS_MAX]; +GLOBAL gid_t *gidlist; GLOBAL int hasyyerrored; GLOBAL char hostname[MAXHOSTNAMELEN+1]; GLOBAL char homedir[MAXPATHLEN]; @@ -324,7 +331,6 @@ GLOBAL char remotehost[MAXHOSTNAMELEN+1]; GLOBAL off_t restart_point; GLOBAL char tmpline[FTP_BUFLEN]; -GLOBAL sig_atomic_t transflag; GLOBAL int type; GLOBAL int usedefault; /* for data transfers */ GLOBAL const char *version; ==== //depot/projects/hammer/contrib/lukemftpd/src/ftpcmd.y#3 (text+ko) ==== @@ -1,7 +1,7 @@ -/* $NetBSD: ftpcmd.y,v 1.73 2003/01/22 04:33:35 lukem Exp $ */ +/* $NetBSD: ftpcmd.y,v 1.80 2004-08-09 12:56:47 lukem Exp $ */ /*- - * Copyright (c) 1997-2002 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -48,11 +48,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -83,7 +79,7 @@ #if 0 static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94"; #else -__RCSID("$NetBSD: ftpcmd.y,v 1.73 2003/01/22 04:33:35 lukem Exp $"); +__RCSID("$NetBSD: ftpcmd.y,v 1.80 2004-08-09 12:56:47 lukem Exp $"); #endif #endif /* not lint */ @@ -98,8 +94,6 @@ #include <ctype.h> #include <errno.h> #include <pwd.h> -#include <setjmp.h> -#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -128,7 +122,7 @@ %union { struct { - off_t o; + LLT ll; int i; } u; char *s; @@ -138,7 +132,7 @@ A B C E F I L N P R S T - SP CRLF COMMA + SP CRLF COMMA ALL USER PASS ACCT CWD CDUP SMNT QUIT REIN PORT PASV TYPE STRU @@ -164,7 +158,6 @@ LEXERR %token <s> STRING -%token <s> ALL %token <u> NUMBER %type <u.i> check_login octal_number byte_size @@ -179,7 +172,7 @@ cmd_sel : cmd { - fromname = NULL; + REASSIGN(fromname, NULL); restart_point = (off_t) 0; } @@ -459,8 +452,7 @@ if (check_write($3, 0)) { if (fromname) { renamecmd(fromname, $3); - free(fromname); - fromname = NULL; + REASSIGN(fromname, NULL); } else { reply(503, "Bad sequence of commands."); } @@ -548,7 +540,7 @@ | SITE SP CHMOD SP octal_number SP pathname CRLF { if (check_write($7, 0)) { - if ($5 > 0777) + if (($5 == -1) || ($5 > 0777)) reply(501, "CHMOD: Mode value must be between 0 and 0777"); else if (chmod($7, $5) < 0) @@ -883,8 +875,8 @@ : REST check_login SP NUMBER CRLF { if ($2) { - fromname = NULL; - restart_point = $4.o; + REASSIGN(fromname, NULL); + restart_point = (off_t)$4.ll; reply(350, "Restarting at " LLF ". Send STORE or RETRIEVE to initiate transfer.", (LLT)restart_point); @@ -894,8 +886,10 @@ | RNFR SP pathname CRLF { restart_point = (off_t) 0; - if (check_write($3, 0)) + if (check_write($3, 0)) { + REASSIGN(fromname, NULL); fromname = renamefrom($3); + } if ($3 != NULL) free($3); } @@ -987,7 +981,7 @@ memset(&data_dest, 0, sizeof(data_dest)); #endif /* INET6 */ /* reject invalid LPRT command */ - if ($1.i != 6.i || $3.i != 16.i || $37.i != 2) + if ($1.i != 6 || $3.i != 16 || $37.i != 2) memset(&data_dest, 0, sizeof(data_dest)); } ; @@ -1302,8 +1296,7 @@ static int check_write(const char *, int); static void help(struct tab *, const char *); static void port_check(const char *, int); -static void toolong(int); -static int yylex(void); + int yylex(void); extern int epsvall; @@ -1449,19 +1442,6 @@ return (s); } -static void -toolong(int signo) -{ - - reply(421, - "Timeout (" LLF " seconds): closing control connection.", - (LLT)curclass.timeout); - if (logging) - syslog(LOG_INFO, "User %s timed out after " LLF " seconds", - (pw ? pw->pw_name : "unknown"), (LLT)curclass.timeout); - dologout(1); -} - void ftp_handle_line(char *cp) { @@ -1475,7 +1455,6 @@ { while (1) { - (void) signal(SIGALRM, toolong); (void) alarm(curclass.timeout); if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { reply(221, "You could at least say goodbye."); @@ -1487,7 +1466,7 @@ /*NOTREACHED*/ } -static int +int yylex(void) { static int cpos, state; @@ -1626,15 +1605,14 @@ c = cmdp[cpos]; cmdp[cpos] = '\0'; yylval.u.i = atoi(cp); - yylval.u.o = strtoull(cp, (char **)NULL, 10); + yylval.u.ll = STRTOLL(cp, (char **)NULL, 10); cmdp[cpos] = c; return (NUMBER); } if (strncasecmp(&cmdp[cpos], "ALL", 3) == 0 - && !isalnum(cmdp[cpos + 3])) { - yylval.s = xstrdup("ALL"); + && !isalnum(cmdp[cpos + 3])) { cpos += 3; - return ALL; + return (ALL); } switch (cmdp[cpos++]) { @@ -1720,9 +1698,7 @@ } yyerror(NULL); state = CMD; - is_oob = 0; - longjmp(errcatch, 0); - /* NOTREACHED */ + return (0); } /* ARGSUSED */ ==== //depot/projects/hammer/contrib/lukemftpd/src/ftpd.8#3 (text+ko) ==== @@ -1,6 +1,6 @@ -.\" $NetBSD: ftpd.8,v 1.69 2002/02/08 01:30:07 ross Exp $ +.\" $NetBSD: ftpd.8,v 1.74 2003-08-07 09:46:39 agc Exp $ .\" -.\" Copyright (c) 1997-2002 The NetBSD Foundation, Inc. +.\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -45,11 +45,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" @@ -67,7 +63,7 @@ .\" .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94 .\" -.Dd October 25, 2002 +.Dd February 26, 2003 .Dt FTPD 8 .Os .Sh NAME @@ -82,6 +78,7 @@ .Op Fl C Ar user .Op Fl e Ar emailaddr .Op Fl h Ar hostname +.Op Fl L Ar xferlogfile .Op Fl P Ar dataport .Op Fl V Ar version .Sh DESCRIPTION @@ -172,6 +169,13 @@ If this option is specified more than once, the retrieve (get), store (put), append, delete, make directory, remove directory and rename operations and their file name arguments are also logged. +.It Fl L Ar xferlogfile +Log +.Tn wu-ftpd +style +.Sq xferlog +entries to +.Ar xferlogfile . .It Fl P Ar dataport Use .Ar dataport @@ -392,7 +396,7 @@ .Dq globbing conventions used by .Xr csh 1 . -This allows users to utilize the metacharacters +This allows users to use the metacharacters .Dq Li \&*?[]{}~ . .Ss User authentication .Nm ==== //depot/projects/hammer/contrib/lukemftpd/src/ftpd.c#3 (text+ko) ==== @@ -1,7 +1,7 @@ -/* $NetBSD: ftpd.c,v 1.150 2003/01/22 04:46:08 lukem Exp $ */ +/* $NetBSD: ftpd.c,v 1.158 2004-08-09 12:56:47 lukem Exp $ */ /* - * Copyright (c) 1997-2001 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2004 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -48,11 +48,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -109,10 +105,10 @@ #if 0 static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: ftpd.c,v 1.150 2003/01/22 04:46:08 lukem Exp $"); +__RCSID("$NetBSD: ftpd.c,v 1.158 2004-08-09 12:56:47 lukem Exp $"); #endif #endif /* not lint */ -__FBSDID("$FreeBSD: src/contrib/lukemftpd/src/ftpd.c,v 1.3 2003/02/02 21:03:28 obrien Exp $"); +__FBSDID("$FreeBSD: src/contrib/lukemftpd/src/ftpd.c,v 1.4 2004/08/18 06:34:20 obrien Exp $"); /* * FTP server. @@ -145,7 +141,6 @@ #include <limits.h> #include <netdb.h> #include <pwd.h> -#include <setjmp.h> #include <signal.h> #include <stdarg.h> #include <stdio.h> @@ -169,14 +164,19 @@ #include <com_err.h> #include <krb5/krb5.h> #endif +#ifdef LOGIN_CAP +#include <login_cap.h> +#endif #define GLOBAL #include "extern.h" #include "pathnames.h" #include "version.h" +volatile sig_atomic_t transflag; +volatile sig_atomic_t urgflag; + int data; -jmp_buf urgcatch; int sflag; int stru; /* avoid C keyword */ int mode; @@ -184,7 +184,8 @@ int dopidfile; /* maintain pid file */ int doutmp; /* update utmp file */ int dowtmp; /* update wtmp file */ -int doxferlog; /* syslog wu-ftpd style xferlog entries */ +int doxferlog; /* syslog/write wu-ftpd style xferlog entries */ +int xferlogfd; /* fd to write wu-ftpd xferlog entries to */ int dropprivs; /* if privileges should or have been dropped */ int mapped; /* IPv4 connection on AF_INET6 socket */ off_t file_size; @@ -200,6 +201,9 @@ static const char *anondir = NULL; static const char *confdir = _DEFAULT_CONFDIR; +static char *curname; /* current USER name */ +static size_t curname_len; /* length of curname (include NUL) */ + #if defined(KERBEROS) || defined(KERBEROS5) int has_ccache = 0; int notickets = 1; @@ -223,6 +227,7 @@ enum send_status { SS_SUCCESS, + SS_ABORTED, /* transfer aborted */ SS_NO_TRANSFER, /* no transfer made yet */ SS_FILE_ERROR, /* file read error */ SS_DATA_ERROR /* data send error */ @@ -253,7 +258,10 @@ static void login_utmp(const char *, const char *, const char *); static void logremotehost(struct sockinet *); static void lostconn(int); -static void myoob(int); +static void toolong(int); +static void sigquit(int); +static void sigurg(int); +static int handleoobcmd(void); static int receive_data(FILE *, FILE *); static int send_data(FILE *, FILE *, const struct stat *, int); static struct passwd *sgetpwnam(const char *); @@ -285,7 +293,9 @@ krb5_error_code kerror; #endif char *p; + const char *xferlogname = NULL; long l; + struct sigaction sa; connections = 1; debug = 0; @@ -297,6 +307,7 @@ doutmp = 0; /* default: Do NOT log to utmp */ dowtmp = 1; /* default: DO log to wtmp */ doxferlog = 0; /* default: Do NOT syslog xferlog */ + xferlogfd = -1; /* default: Do NOT write xferlog file */ dropprivs = 0; mapped = 0; usedefault = 1; @@ -313,7 +324,7 @@ */ openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "a:c:C:de:h:HlP:qQrst:T:uUvV:wWX")) + while ((ch = getopt(argc, argv, "a:c:C:de:h:HlL:P:qQrst:T:uUvV:wWX")) != -1) { switch (ch) { case 'a': @@ -352,6 +363,10 @@ logging++; /* > 1 == extra logging */ break; + case 'L': + xferlogname = optarg; + break; + case 'P': errno = 0; p = NULL; @@ -413,7 +428,7 @@ break; case 'X': - doxferlog = 1; + doxferlog |= 1; break; default: @@ -426,6 +441,23 @@ if (EMPTYSTR(confdir)) confdir = _DEFAULT_CONFDIR; + errno = 0; + l = sysconf(_SC_LOGIN_NAME_MAX); + if (l == -1 && errno != 0) { + syslog(LOG_ERR, "sysconf _SC_LOGIN_NAME_MAX: %m"); + exit(1); + } else if (l <= 0) { + syslog(LOG_WARNING, "using conservative LOGIN_NAME_MAX value"); + curname_len = _POSIX_LOGIN_NAME_MAX; + } else + curname_len = (size_t)l; + curname = malloc(curname_len); + if (curname == NULL) { + syslog(LOG_ERR, "malloc: %m"); + exit(1); + } + curname[0] = '\0'; + memset((char *)&his_addr, 0, sizeof(his_addr)); addrlen = sizeof(his_addr.si_su); if (getpeername(0, (struct sockaddr *)&his_addr.si_su, &addrlen) < 0) { @@ -506,10 +538,26 @@ (void)snprintf(ttyline, sizeof(ttyline), "ftp%d", getpid()); (void) freopen(_PATH_DEVNULL, "w", stderr); >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408190248.i7J2mAg8008598>