summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2000-03-05 06:12:19 +0000
committerlukem <lukem@NetBSD.org>2000-03-05 06:12:19 +0000
commitf318090c600b95d167bddfd23cc7e8e47e5ccd09 (patch)
tree79c6c369a9dcd4c967cd9f0c3abbcf5f79f14978 /libexec
parente68fefb8553219edf7801ef024dd9c6633ccbadb (diff)
* don't bother with a version[] string, just use the macro as appropriate
* clean some more of the GLOBAL stuff * fix unused var if -UHASSETPROCTITLE
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/Makefile4
-rw-r--r--libexec/ftpd/extern.h29
-rw-r--r--libexec/ftpd/ftpcmd.y8
-rw-r--r--libexec/ftpd/ftpd.c50
-rw-r--r--libexec/ftpd/logwtmp.c5
-rw-r--r--libexec/ftpd/popen.c5
-rw-r--r--libexec/ftpd/version.h4
7 files changed, 42 insertions, 63 deletions
diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile
index a0125ce6fd7..47a387b9106 100644
--- a/libexec/ftpd/Makefile
+++ b/libexec/ftpd/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 1999/12/18 05:51:34 lukem Exp $
+# $NetBSD: Makefile,v 1.40 2000/03/05 06:12:19 lukem Exp $
# @(#)Makefile 8.2 (Berkeley) 4/4/94
SRCTOP= ../..
@@ -25,7 +25,7 @@ DPADD+= ${LIBSKEY}
LDADD+= -lskey
.endif
-ftpd.o: version.h
+ftpd.o ftpcmd.o: version.h
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/libexec/ftpd/Makefile.frag"
diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h
index 23ac9b8283b..347cbab087a 100644
--- a/libexec/ftpd/extern.h
+++ b/libexec/ftpd/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.24 2000/01/13 00:04:31 lukem Exp $ */
+/* $NetBSD: extern.h,v 1.25 2000/03/05 06:12:19 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -204,35 +204,44 @@ extern int yyparse __P((void));
#define GLOBAL extern
#endif
+
+GLOBAL union sockunion ctrl_addr;
+GLOBAL union sockunion data_dest;
+GLOBAL union sockunion data_source;
+GLOBAL union sockunion his_addr;
+GLOBAL union sockunion pasv_addr;
GLOBAL int connections;
GLOBAL struct ftpclass curclass;
-GLOBAL union sockunion data_dest;
GLOBAL int debug;
GLOBAL jmp_buf errcatch;
GLOBAL int form;
GLOBAL int hasyyerrored;
-GLOBAL union sockunion his_addr;
-GLOBAL char hostname[];
+GLOBAL char hostname[MAXHOSTNAMELEN+1];
#ifdef KERBEROS5
GLOBAL krb5_context kcontext;
#endif
GLOBAL int logged_in;
GLOBAL int logging;
-GLOBAL int pdata;
-GLOBAL char proctitle[];
+GLOBAL int pdata; /* for passive mode */
+#ifdef HASSETPROCTITLE
+GLOBAL char proctitle[BUFSIZ]; /* initial part of title */
+#endif
GLOBAL struct passwd *pw;
GLOBAL int quietmessages;
-GLOBAL char remotehost[];
+GLOBAL char remotehost[MAXHOSTNAMELEN+1];
GLOBAL off_t restart_point;
-GLOBAL char tmpline[];
+GLOBAL char tmpline[7];
GLOBAL sig_atomic_t transflag;
GLOBAL int type;
-GLOBAL int usedefault;
-GLOBAL const char version[];
+GLOBAL int usedefault; /* for data transfers */
+ /* total file data bytes */
GLOBAL off_t total_data_in, total_data_out, total_data;
+ /* total number of data files */
GLOBAL off_t total_files_in, total_files_out, total_files;
+ /* total bytes */
GLOBAL off_t total_bytes_in, total_bytes_out, total_bytes;
+ /* total number of xfers */
GLOBAL off_t total_xfers_in, total_xfers_out, total_xfers;
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index 1d0295bc020..3855e414a53 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpcmd.y,v 1.44 2000/01/12 22:39:28 lukem Exp $ */
+/* $NetBSD: ftpcmd.y,v 1.45 2000/03/05 06:12:19 lukem Exp $ */
/*-
* Copyright (c) 1997-1999 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
#if 0
static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94";
#else
-__RCSID("$NetBSD: ftpcmd.y,v 1.44 2000/01/12 22:39:28 lukem Exp $");
+__RCSID("$NetBSD: ftpcmd.y,v 1.45 2000/03/05 06:12:19 lukem Exp $");
#endif
#endif /* not lint */
@@ -115,6 +115,7 @@ __RCSID("$NetBSD: ftpcmd.y,v 1.44 2000/01/12 22:39:28 lukem Exp $");
#endif
#include "extern.h"
+#include "version.h"
static int cmd_type;
static int cmd_form;
@@ -854,7 +855,8 @@ cmd
| SYST CRLF
{
- reply(215, "UNIX Type: L%d %s", NBBY, version);
+ reply(215, "UNIX Type: L%d Version: %s", NBBY,
+ FTPD_VERSION);
}
| STAT check_login SP pathname CRLF
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 9ba68130093..91e9a79e1c0 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpd.c,v 1.86 2000/02/14 03:26:06 aidan Exp $ */
+/* $NetBSD: ftpd.c,v 1.87 2000/03/05 06:12:19 lukem Exp $ */
/*
* Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: ftpd.c,v 1.86 2000/02/14 03:26:06 aidan Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.87 2000/03/05 06:12:19 lukem Exp $");
#endif
#endif /* not lint */
@@ -171,53 +171,20 @@ __RCSID("$NetBSD: ftpd.c,v 1.86 2000/02/14 03:26:06 aidan Exp $");
#include <varargs.h>
#endif
-const char version[] = FTPD_VERSION;
-
-union sockunion ctrl_addr;
-union sockunion data_source;
-union sockunion data_dest;
-union sockunion his_addr;
-union sockunion pasv_addr;
-
int data;
-jmp_buf errcatch, urgcatch;
-int logged_in;
-int connections = 1;
+jmp_buf urgcatch;
struct passwd *pw;
-int debug;
int sflag;
-int logging;
-int type;
-int form;
int stru; /* avoid C keyword */
int mode;
int doutmp = 0; /* update utmp file */
-int usedefault = 1; /* for data transfers */
-int pdata = -1; /* for passive mode */
int mapped = 0; /* IPv4 connection on AF_INET6 socket */
-sig_atomic_t transflag;
off_t file_size;
off_t byte_count;
-char tmpline[7];
-char hostname[MAXHOSTNAMELEN+1];
-char remotehost[MAXHOSTNAMELEN+1];
static char ttyline[20];
char *tty = ttyline; /* for klogin */
static struct utmp utmp; /* for utmp */
-off_t total_data_in; /* total file data bytes received */
-off_t total_data_out; /* total file data bytes sent data */
-off_t total_data; /* total file data bytes transferred data */
-off_t total_files_in; /* total number of data files received */
-off_t total_files_out; /* total number of data files sent */
-off_t total_files; /* total number of data files transferred */
-off_t total_bytes_in; /* total bytes received */
-off_t total_bytes_out; /* total bytes sent */
-off_t total_bytes; /* total bytes transferred */
-off_t total_xfers_in; /* total number of xfers incoming */
-off_t total_xfers_out; /* total number of xfers outgoing */
-off_t total_xfers; /* total number of xfers */
-
static char *anondir = NULL;
static char confdir[MAXPATHLEN];
@@ -239,10 +206,6 @@ int epsvall = 0;
int swaitmax = SWAITMAX;
int swaitint = SWAITINT;
-#ifdef HASSETPROCTITLE
-char proctitle[BUFSIZ]; /* initial part of title */
-#endif /* HASSETPROCTITLE */
-
#define CURCLASSTYPE curclass.type == CLASS_GUEST ? "GUEST" : \
curclass.type == CLASS_CHROOT ? "CHROOT" : \
curclass.type == CLASS_REAL ? "REAL" : \
@@ -282,9 +245,12 @@ main(argc, argv)
krb5_error_code kerror;
#endif
+ connections = 1;
debug = 0;
logging = 0;
+ pdata = -1;
sflag = 0;
+ usedefault = 1;
(void)strcpy(confdir, _DEFAULT_CONFDIR);
hostname[0] = '\0';
@@ -473,7 +439,7 @@ main(argc, argv)
}
(void)format_file(conffilename(_PATH_FTPWELCOME), 220);
/* reply(220,) must follow */
- reply(220, "%s FTP server (%s) ready.", hostname, version);
+ reply(220, "%s FTP server (%s) ready.", hostname, FTPD_VERSION);
(void) setjmp(errcatch);
for (;;)
@@ -1733,7 +1699,7 @@ statcmd()
a = p = (u_char *)NULL;
lreply(211, "%s FTP server status:", hostname);
- lreply(0, "%s", version);
+ lreply(0, "Version: %s", FTPD_VERSION);
ntop_buf[0] = '\0';
if (!getnameinfo((struct sockaddr *)&his_addr, his_addr.su_len,
ntop_buf, sizeof(ntop_buf), NULL, 0, NI_NUMERICHOST)
diff --git a/libexec/ftpd/logwtmp.c b/libexec/ftpd/logwtmp.c
index b4666eed609..5e99ce99f9a 100644
--- a/libexec/ftpd/logwtmp.c
+++ b/libexec/ftpd/logwtmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: logwtmp.c,v 1.13 2000/01/12 22:39:29 lukem Exp $ */
+/* $NetBSD: logwtmp.c,v 1.14 2000/03/05 06:12:19 lukem Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -40,11 +40,12 @@
#if 0
static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: logwtmp.c,v 1.13 2000/01/12 22:39:29 lukem Exp $");
+__RCSID("$NetBSD: logwtmp.c,v 1.14 2000/03/05 06:12:19 lukem Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/time.h>
#include <sys/stat.h>
diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c
index 318087020ad..3eeec514c56 100644
--- a/libexec/ftpd/popen.c
+++ b/libexec/ftpd/popen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: popen.c,v 1.19 2000/01/12 22:39:29 lukem Exp $ */
+/* $NetBSD: popen.c,v 1.20 2000/03/05 06:12:19 lukem Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -78,11 +78,12 @@
#if 0
static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94";
#else
-__RCSID("$NetBSD: popen.c,v 1.19 2000/01/12 22:39:29 lukem Exp $");
+__RCSID("$NetBSD: popen.c,v 1.20 2000/03/05 06:12:19 lukem Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/wait.h>
#include <errno.h>
diff --git a/libexec/ftpd/version.h b/libexec/ftpd/version.h
index cd0225f54da..ebe9427fb9e 100644
--- a/libexec/ftpd/version.h
+++ b/libexec/ftpd/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.7 2000/01/13 00:04:32 lukem Exp $ */
+/* $NetBSD: version.h,v 1.8 2000/03/05 06:12:19 lukem Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -36,5 +36,5 @@
*/
#ifndef FTPD_VERSION
-#define FTPD_VERSION "Version: NetBSD-ftpd/20000113"
+#define FTPD_VERSION "NetBSD-ftpd 20000305"
#endif