summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-20 22:40:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-20 22:40:43 +0000
commit2ec79f337bae869c31c4dcea714414dcc27762a3 (patch)
tree3619eba8432a29db73ae6e940b2a093b73828151
parent6f8ae11c5d50d06b8bdafe0dd2361bc49b000cfe (diff)
bad arguments? usage() should syslog()
-rw-r--r--libexec/fingerd/fingerd.c16
-rw-r--r--libexec/identd/identd.c35
-rw-r--r--libexec/rlogind/rlogind.c3
-rw-r--r--libexec/telnetd/telnetd.c39
4 files changed, 50 insertions, 43 deletions
diff --git a/libexec/fingerd/fingerd.c b/libexec/fingerd/fingerd.c
index 776b43b952a..87cee1cc7ea 100644
--- a/libexec/fingerd/fingerd.c
+++ b/libexec/fingerd/fingerd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fingerd.c,v 1.14 1999/07/03 18:24:13 deraadt Exp $ */
+/* $OpenBSD: fingerd.c,v 1.15 1999/07/20 22:40:37 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "from: @(#)fingerd.c 8.1 (Berkeley) 6/4/93";
#else
-static char rcsid[] = "$OpenBSD: fingerd.c,v 1.14 1999/07/03 18:24:13 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fingerd.c,v 1.15 1999/07/20 22:40:37 deraadt Exp $";
#endif
#endif /* not lint */
@@ -62,6 +62,16 @@ static char rcsid[] = "$OpenBSD: fingerd.c,v 1.14 1999/07/03 18:24:13 deraadt Ex
#include "pathnames.h"
void err __P((const char *, ...));
+void usage __P((void));
+
+void
+usage()
+{
+ syslog(LOG_ERR,
+ "usage: ftpd [-slumMpS] [-P filename]");
+ exit(2);
+}
+
int
main(argc, argv)
@@ -109,7 +119,7 @@ main(argc, argv)
break;
case '?':
default:
- err("illegal option -- %c", ch);
+ usage();
}
if (logging) {
diff --git a/libexec/identd/identd.c b/libexec/identd/identd.c
index 2d8f14504f1..ad3dabb801b 100644
--- a/libexec/identd/identd.c
+++ b/libexec/identd/identd.c
@@ -5,16 +5,6 @@
* Please send bug fixes/bug reports to: Peter Eriksson <pen@lysator.liu.se>
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <unistd.h>
-
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -23,14 +13,21 @@
#include <sys/time.h>
#include <sys/wait.h>
-#include <pwd.h>
-#include <grp.h>
-
#include <netinet/in.h>
-
#include <arpa/inet.h>
-extern int errno;
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <syslog.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <grp.h>
#include "identd.h"
#include "error.h"
@@ -63,10 +60,10 @@ static int syslog_facility = LOG_DAEMON;
void
usage()
{
- fprintf(stderr,
- "identd [-i | -w | -b] [-t seconds] [-u uid] [-g gid] [-p port]\n"
- "\t[-a address] [-c charset] [-noelVvmNdh]\n");
- exit(1);
+ syslog(LOG_ERR,
+ "identd [-i | -w | -b] [-t seconds] [-u uid] [-g gid] [-p port] "
+ "[-a address] [-c charset] [-noelVvmNdh]");
+ exit(2);
}
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index 254a2a1e2fe..8786b8fbda3 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93"; */
-static char *rcsid = "$Id: rlogind.c,v 1.20 1997/06/29 11:10:29 provos Exp $";
+static char *rcsid = "$Id: rlogind.c,v 1.21 1999/07/20 22:40:40 deraadt Exp $";
#endif /* not lint */
/*
@@ -717,4 +717,5 @@ usage()
#else
syslog(LOG_ERR, "usage: rlogind [-aln]");
#endif
+ exit(2);
}
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index 4ca3c3fafcf..1de5fab0de3 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: telnetd.c,v 1.16 1998/12/19 01:27:07 deraadt Exp $ */
+/* $OpenBSD: telnetd.c,v 1.17 1999/07/20 22:40:42 deraadt Exp $ */
/* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: telnetd.c,v 1.16 1998/12/19 01:27:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: telnetd.c,v 1.17 1999/07/20 22:40:42 deraadt Exp $";
#endif
#endif /* not lint */
@@ -537,44 +537,43 @@ main(argc, argv)
void
usage()
{
- fprintf(stderr, "Usage: telnetd");
+ syslog(LOG_ERR, "usage: telnetd"
#ifdef AUTHENTICATION
- fprintf(stderr, " [-a (debug|other|user|valid|off|none)]\n\t");
+ " [-a (debug|other|user|valid|off|none)]"
#endif
#ifdef BFTPDAEMON
- fprintf(stderr, " [-B]");
+ " [-B]"
#endif
- fprintf(stderr, " [-debug]");
+ " [-debug]"
#ifdef DIAGNOSTICS
- fprintf(stderr, " [-D (options|report|exercise|netdata|ptydata)]\n\t");
+ " [-D (options|report|exercise|netdata|ptydata)]\n\t"
#endif
#ifdef AUTHENTICATION
- fprintf(stderr, " [-edebug]");
+ " [-edebug]"
#endif
- fprintf(stderr, " [-h]");
+ " [-h]"
#if defined(CRAY) && defined(NEWINIT)
- fprintf(stderr, " [-Iinitid]");
+ " [-Iinitid]"
#endif
#if defined(LINEMODE) && defined(KLUDGELINEMODE)
- fprintf(stderr, " [-k]");
+ " [-k]"
#endif
#ifdef LINEMODE
- fprintf(stderr, " [-l]");
+ " [-l]"
#endif
- fprintf(stderr, " [-n]");
+ " [-n]"
#ifdef CRAY
- fprintf(stderr, " [-r[lowpty]-[highpty]]");
+ " [-r[lowpty]-[highpty]]"
#endif
- fprintf(stderr, "\n\t");
#ifdef HAS_GETTOS
- fprintf(stderr, " [-S tos]");
+ " [-S tos]"
#endif
#ifdef AUTHENTICATION
- fprintf(stderr, " [-X auth-type]");
+ " [-X auth-type]"
#endif
- fprintf(stderr, " [-u utmp_hostname_length] [-U]");
- fprintf(stderr, " [port]\n");
- exit(1);
+ " [-u utmp_hostname_length] [-U]"
+ " [port]");
+ exit(2);
}
/*