Module Name:    othersrc
Committed By:   lukem
Date:           Thu Mar 21 01:01:57 UTC 2013

Modified Files:
        othersrc/libexec/tnftpd/src: cmds.c conf.c extern.h ftpcmd.y ftpd.c
            logutmp.c version.h

Log Message:
Merge NetBSD-20130321


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 othersrc/libexec/tnftpd/src/cmds.c \
    othersrc/libexec/tnftpd/src/extern.h
cvs rdiff -u -r1.10 -r1.11 othersrc/libexec/tnftpd/src/conf.c
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/src/ftpcmd.y
cvs rdiff -u -r1.33 -r1.34 othersrc/libexec/tnftpd/src/ftpd.c
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/logutmp.c
cvs rdiff -u -r1.7 -r1.8 othersrc/libexec/tnftpd/src/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/libexec/tnftpd/src/cmds.c
diff -u othersrc/libexec/tnftpd/src/cmds.c:1.15 othersrc/libexec/tnftpd/src/cmds.c:1.16
--- othersrc/libexec/tnftpd/src/cmds.c:1.15	Wed Mar 20 09:13:44 2013
+++ othersrc/libexec/tnftpd/src/cmds.c	Thu Mar 21 01:01:56 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: cmds.c,v 1.15 2013/03/20 09:13:44 lukem Exp $	*/
-/*	from	NetBSD: cmds.c,v 1.30 2009/03/15 07:48:36 lukem Exp	*/
+/*	$NetBSD: cmds.c,v 1.16 2013/03/21 01:01:56 lukem Exp $	*/
+/*	from	NetBSD: cmds.c,v 1.31 2012/06/19 06:06:34 dholland Exp	*/
 
 /*
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID(" NetBSD: cmds.c,v 1.30 2009/03/15 07:48:36 lukem Exp  ");
+__RCSID(" NetBSD: cmds.c,v 1.31 2012/06/19 06:06:34 dholland Exp  ");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -852,9 +852,7 @@ replydirname(const char *name, const cha
 }
 
 static void
-discover_path(last_path, new_path) 
-	char *last_path;
-	const char *new_path;
+discover_path(char *last_path, const char *new_path) 
 {
 	char tp[MAXPATHLEN + 1] = "";
 	char tq[MAXPATHLEN + 1] = "";
Index: othersrc/libexec/tnftpd/src/extern.h
diff -u othersrc/libexec/tnftpd/src/extern.h:1.15 othersrc/libexec/tnftpd/src/extern.h:1.16
--- othersrc/libexec/tnftpd/src/extern.h:1.15	Wed Mar 20 09:13:44 2013
+++ othersrc/libexec/tnftpd/src/extern.h	Thu Mar 21 01:01:56 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: extern.h,v 1.15 2013/03/20 09:13:44 lukem Exp $	*/
-/*	from	NetBSD: extern.h,v 1.61 2009/07/13 19:05:40 roy Exp	*/
+/*	$NetBSD: extern.h,v 1.16 2013/03/21 01:01:56 lukem Exp $	*/
+/*	from	NetBSD: extern.h,v 1.62 2011/08/29 20:41:06 joerg Exp	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -133,8 +133,8 @@ FILE   *dataconn(const char *, off_t, co
 void	delete(const char *);
 int	display_file(const char *, int);
 const char **do_conversion(const char *);
-void	dologout(int);
-void	fatal(const char *);
+__dead void	dologout(int);
+__dead void	fatal(const char *);
 void	feat(void);
 void	format_path(char *, const char *);
 int	ftpd_pclose(FILE *);

Index: othersrc/libexec/tnftpd/src/conf.c
diff -u othersrc/libexec/tnftpd/src/conf.c:1.10 othersrc/libexec/tnftpd/src/conf.c:1.11
--- othersrc/libexec/tnftpd/src/conf.c:1.10	Sat Nov  7 03:26:21 2009
+++ othersrc/libexec/tnftpd/src/conf.c	Thu Mar 21 01:01:56 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: conf.c,v 1.10 2009/11/07 03:26:21 lukem Exp $	*/
-/*	from	NetBSD: conf.c,v 1.62 2009/03/15 07:48:36 lukem Exp	*/
+/*	$NetBSD: conf.c,v 1.11 2013/03/21 01:01:56 lukem Exp $	*/
+/*	from	NetBSD: conf.c,v 1.64 2012/11/04 20:46:46 christos Exp	*/
 
 /*-
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID(" NetBSD: conf.c,v 1.62 2009/03/15 07:48:36 lukem Exp  ");
+__RCSID(" NetBSD: conf.c,v 1.64 2012/11/04 20:46:46 christos Exp  ");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -47,6 +47,7 @@ __RCSID(" NetBSD: conf.c,v 1.62 2009/03/
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <pwd.h>
 #include <glob.h>
 #include <netdb.h>
 #include <signal.h>
@@ -818,7 +819,7 @@ do_conversion(const char *fname)
 	int		 o_errno;
 	char		*base = NULL;
 	char		*cmd, *p, *lp;
-	const char	**argv;
+	char	       **argv;
 	StringList	*sl;
 
 	o_errno = errno;
@@ -867,10 +868,10 @@ do_conversion(const char *fname)
 
 	if (sl_add(sl, NULL) == -1)
 		goto cleanup_do_conv;
-	argv = (const char **)sl->sl_str;
+	argv = sl->sl_str;
 	free(cmd);
 	free(sl);
-	return(argv);
+	return (void *)(intptr_t)argv;
 
  cleanup_do_conv:
 	if (sl)

Index: othersrc/libexec/tnftpd/src/ftpcmd.y
diff -u othersrc/libexec/tnftpd/src/ftpcmd.y:1.17 othersrc/libexec/tnftpd/src/ftpcmd.y:1.18
--- othersrc/libexec/tnftpd/src/ftpcmd.y:1.17	Wed Mar 20 09:13:44 2013
+++ othersrc/libexec/tnftpd/src/ftpcmd.y	Thu Mar 21 01:01:57 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: ftpcmd.y,v 1.17 2013/03/20 09:13:44 lukem Exp $	*/
-/*	from	NetBSD: ftpcmd.y,v 1.90 2009/07/13 19:05:40 roy Exp	*/
+/*	$NetBSD: ftpcmd.y,v 1.18 2013/03/21 01:01:57 lukem Exp $	*/
+/*	from	NetBSD: ftpcmd.y,v 1.93 2011/09/16 16:13:17 plunky Exp	*/
 
 /*-
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpcmd.y	8.3 (Berkeley) 4/6/94";
 #else
-__RCSID(" NetBSD: ftpcmd.y,v 1.90 2009/07/13 19:05:40 roy Exp  ");
+__RCSID(" NetBSD: ftpcmd.y,v 1.93 2011/09/16 16:13:17 plunky Exp  ");
 #endif
 #endif /* not lint */
 
@@ -975,18 +975,24 @@ host_long_port6
 		NUMBER
 		{
 #ifdef INET6
-			char *a, *p;
+			unsigned char buf[16];
 
-			memset(&data_dest, 0, sizeof(data_dest));
+			(void)memset(&data_dest, 0, sizeof(data_dest));
 			data_dest.su_len = sizeof(struct sockaddr_in6);
 			data_dest.su_family = AF_INET6;
-			p = (char *)&data_dest.su_port;
-			p[0] = $39.i; p[1] = $41.i;
-			a = (char *)&data_dest.si_su.su_sin6.sin6_addr;
-			a[0] = $5.i; a[1] = $7.i; a[2] = $9.i; a[3] = $11.i;
-			a[4] = $13.i; a[5] = $15.i; a[6] = $17.i; a[7] = $19.i;
-			a[8] = $21.i; a[9] = $23.i; a[10] = $25.i; a[11] = $27.i;
-			a[12] = $29.i; a[13] = $31.i; a[14] = $33.i; a[15] = $35.i;
+			buf[0] = $39.i; buf[1] = $41.i;
+			(void)memcpy(&data_dest.su_port, buf,
+			    sizeof(data_dest.su_port));
+			buf[0] = $5.i; buf[1] = $7.i;
+			buf[2] = $9.i; buf[3] = $11.i;
+			buf[4] = $13.i; buf[5] = $15.i;
+			buf[6] = $17.i; buf[7] = $19.i;
+			buf[8] = $21.i; buf[9] = $23.i;
+			buf[10] = $25.i; buf[11] = $27.i;
+			buf[12] = $29.i; buf[13] = $31.i;
+			buf[14] = $33.i; buf[15] = $35.i;
+			(void)memcpy(&data_dest.si_su.su_sin6.sin6_addr,
+			    buf, sizeof(data_dest.si_su.su_sin6.sin6_addr));
 			if (his_addr.su_family == AF_INET6) {
 				/* XXX: more sanity checks! */
 				data_dest.su_scope_id = his_addr.su_scope_id;
@@ -1635,7 +1641,7 @@ yylex(void)
 			c = cmdp[cpos];
 			cmdp[cpos] = '\0';
 			yylval.u.i = atoi(cp);
-			yylval.u.ll = STRTOLL(cp, (char **)NULL, 10);
+			yylval.u.ll = STRTOLL(cp, NULL, 10);
 			cmdp[cpos] = c;
 			return (NUMBER);
 		}

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.33 othersrc/libexec/tnftpd/src/ftpd.c:1.34
--- othersrc/libexec/tnftpd/src/ftpd.c:1.33	Wed Mar 20 09:13:44 2013
+++ othersrc/libexec/tnftpd/src/ftpd.c	Thu Mar 21 01:01:57 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: ftpd.c,v 1.33 2013/03/20 09:13:44 lukem Exp $	*/
-/*	from	NetBSD: ftpd.c,v 1.194 2009/07/13 19:05:40 roy Exp	*/
+/*	$NetBSD: ftpd.c,v 1.34 2013/03/21 01:01:57 lukem Exp $	*/
+/*	from	NetBSD: ftpd.c,v 1.198 2012/06/19 06:06:34 dholland Exp	*/
 
 /*
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
 #if 0
 static char sccsid[] = "@(#)ftpd.c	8.5 (Berkeley) 4/28/95";
 #else
-__RCSID(" NetBSD: ftpd.c,v 1.194 2009/07/13 19:05:40 roy Exp  ");
+__RCSID(" NetBSD: ftpd.c,v 1.198 2012/06/19 06:06:34 dholland Exp  ");
 #endif
 #endif /* not lint */
 
@@ -268,9 +268,9 @@ static int	 ftpd_poll(struct pollfd *, i
 static void	 login_utmp(const char *, const char *, const char *,
 		     struct sockinet *);
 static void	 logremotehost(struct sockinet *);
-static void	 lostconn(int);
-static void	 toolong(int);
-static void	 sigquit(int);
+__dead static void	 lostconn(int);
+__dead static void	 toolong(int);
+__dead static void	 sigquit(int);
 static void	 sigurg(int);
 static int	 handleoobcmd(void);
 static int	 receive_data(FILE *, FILE *);
@@ -640,7 +640,8 @@ main(int argc, char *argv[])
 	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) {
-		syslog(LOG_ERR, "getpeername (%s): %m",argv[0]);
+		syslog((errno == ENOTCONN) ? LOG_NOTICE : LOG_ERR,
+		    "getpeername (%s): %m",argv[0]);
 		exit(1);
 	}
 	his_addr.su_len = addrlen;
@@ -2680,7 +2681,7 @@ statcmd(void)
 	int ispassive, af;
 	off_t otbi, otbo, otb;
 
-	a = p = (unsigned char *)NULL;
+	a = p = NULL;
 
 	reply(-211, "%s FTP server status:", hostname);
 	reply(0, "Version: %s", EMPTYSTR(version) ? "<suppressed>" : version);
@@ -3071,7 +3072,7 @@ statxfer(void)
  * by setting transflag to 0. (c.f., "ABOR").
  */
 static int
-handleoobcmd()
+handleoobcmd(void)
 {
 	char *cp;
 	int ret;

Index: othersrc/libexec/tnftpd/src/logutmp.c
diff -u othersrc/libexec/tnftpd/src/logutmp.c:1.2 othersrc/libexec/tnftpd/src/logutmp.c:1.3
--- othersrc/libexec/tnftpd/src/logutmp.c:1.2	Sun Sep 21 14:44:01 2008
+++ othersrc/libexec/tnftpd/src/logutmp.c	Thu Mar 21 01:01:57 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: logutmp.c,v 1.2 2008/09/21 14:44:01 lukem Exp $	*/
-/*	from	NetBSD: logutmp.c,v 1.11 2008/06/09 01:00:23 lukem Exp	*/
+/*	$NetBSD: logutmp.c,v 1.3 2013/03/21 01:01:57 lukem Exp $	*/
+/*	from	NetBSD: logutmp.c,v 1.12 2011/09/16 16:13:17 plunky Exp	*/
 
 /*
  * Portions Copyright (c) 1988, 1993
@@ -61,7 +61,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID(" NetBSD: logutmp.c,v 1.11 2008/06/09 01:00:23 lukem Exp  ");
+__RCSID(" NetBSD: logutmp.c,v 1.12 2011/09/16 16:13:17 plunky Exp  ");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -105,7 +105,7 @@ ftpd_login(const struct utmp *ut)
 	 */
 	if (topslot < 0) {
 		topslot = 0;
-		while (getttyent() != (struct ttyent *)NULL)
+		while (getttyent() != NULL)
 			topslot++;
 	}
 	if ((topslot < 0) || ((fd < 0)

Index: othersrc/libexec/tnftpd/src/version.h
diff -u othersrc/libexec/tnftpd/src/version.h:1.7 othersrc/libexec/tnftpd/src/version.h:1.8
--- othersrc/libexec/tnftpd/src/version.h:1.7	Wed Mar 24 12:11:20 2010
+++ othersrc/libexec/tnftpd/src/version.h	Thu Mar 21 01:01:57 2013
@@ -1,7 +1,7 @@
-/*	$NetBSD: version.h,v 1.7 2010/03/24 12:11:20 lukem Exp $	*/
-/*	from	NetBSD: version.h,v 1.74 2010/03/21 20:27:26 lukem Exp	*/
+/*	$NetBSD: version.h,v 1.8 2013/03/21 01:01:57 lukem Exp $	*/
+/*	from	NetBSD: version.h,v 1.75 2013/03/21 00:17:26 lukem Exp	*/
 /*-
- * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2013 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,5 +30,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	"NetBSD-ftpd 20100320"
+#define	FTPD_VERSION	"NetBSD-ftpd 20110904"
 #endif

Reply via email to