summaryrefslogtreecommitdiff
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-20 19:55:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-20 19:55:07 +0000
commit3298e9b2dc84b04584f33f4882edf1ef41c3a14d (patch)
treeceb525b1c88f28f2845c14716c68b2e3a686e2db /libexec/ftpd/ftpd.c
parent1b8e697a6d3cd0edfd797214d64eec03736216aa (diff)
do not proceed if incorrect args are found; found by form
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index d85b0c05473..09626410925 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.54 1999/04/29 21:38:43 downsj Exp $ */
+/* $OpenBSD: ftpd.c,v 1.55 1999/07/20 19:55:06 deraadt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -225,6 +225,7 @@ static struct passwd *
static char *sgetsave __P((char *));
static void reapchild __P((int));
static int check_host __P((struct sockaddr_in *));
+static void usage __P((void));
void logxfer __P((char *, off_t, time_t));
@@ -241,6 +242,16 @@ curdir()
return (guest ? path+1 : path);
}
+char *argstr = "AdDhlMSt:T:u:UvP";
+
+static void
+usage()
+{
+ syslog(LOG_ERR,
+ "usage: ftpd [-AdDhlMSUv] [-t timeout] [-T maxtimeout] [-u mask]");
+ exit(2);
+}
+
int
main(argc, argv, envp)
int argc;
@@ -250,7 +261,6 @@ main(argc, argv, envp)
int addrlen, ch, on = 1, tos;
char *cp, line[LINE_MAX];
FILE *fd;
- char *argstr = "AdDhlMSt:T:u:UvP";
struct hostent *hp;
tzset(); /* in case no timezone database in ~ftp */
@@ -325,7 +335,7 @@ main(argc, argv, envp)
break;
default:
- warnx("unknown flag -%c ignored", optopt);
+ usage();
break;
}
}