diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-16 10:16:11 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-16 10:16:11 +0000 |
commit | d74465ceed8eda341356aae3064c124591929955 (patch) | |
tree | 6f22aab1c048018ebeb0337492ee75f7c0f4caf0 /libexec/identd | |
parent | acd1fa13c0393c09f8d9faf4af549936532dbda3 (diff) |
minor cleanup, and toast -V
Diffstat (limited to 'libexec/identd')
-rw-r--r-- | libexec/identd/Makefile | 4 | ||||
-rw-r--r-- | libexec/identd/identd.8 | 6 | ||||
-rw-r--r-- | libexec/identd/identd.c | 19 | ||||
-rw-r--r-- | libexec/identd/openbsd.c | 6 | ||||
-rw-r--r-- | libexec/identd/parse.c | 13 | ||||
-rw-r--r-- | libexec/identd/version.c | 2 |
6 files changed, 20 insertions, 30 deletions
diff --git a/libexec/identd/Makefile b/libexec/identd/Makefile index f96361c8bae..567619b509b 100644 --- a/libexec/identd/Makefile +++ b/libexec/identd/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.6 2001/01/28 19:34:28 niklas Exp $ +# $OpenBSD: Makefile,v 1.7 2002/07/16 10:16:10 deraadt Exp $ PROG= identd -SRCS= identd.c openbsd.c parse.c version.c +SRCS= identd.c openbsd.c parse.c MAN= identd.8 CFLAGS+= -Wall -Werror diff --git a/libexec/identd/identd.8 b/libexec/identd/identd.8 index 7c2bb6ff41a..c9d33fd47d4 100644 --- a/libexec/identd/identd.8 +++ b/libexec/identd/identd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: identd.8,v 1.17 2001/04/13 20:16:53 millert Exp $ +.\" $OpenBSD: identd.8,v 1.18 2002/07/16 10:16:10 deraadt Exp $ .\" .\" Copyright (c) 1997, Jason Downs. All rights reserved. .\" @@ -49,7 +49,7 @@ .Op Fl p Ar port .Op Fl a Ar address .Op Fl c Ar charset -.Op Fl noelVvmNUdh +.Op Fl noelvmNUdh .Sh DESCRIPTION .Nm is a server which implements the @@ -132,8 +132,6 @@ Default is "auth" (113). Specify a local IP address in dotted quad format to bind the listen socket to if running as a standalone daemon. By default the daemon listens on all local IP addresses. -.It Fl V -Print the version number and the exit. .It Fl l Use .Xr syslogd 8 diff --git a/libexec/identd/identd.c b/libexec/identd/identd.c index 4003255991f..4afe9e85ec4 100644 --- a/libexec/identd/identd.c +++ b/libexec/identd/identd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identd.c,v 1.27 2002/06/22 20:34:31 deraadt Exp $ */ +/* $OpenBSD: identd.c,v 1.28 2002/07/16 10:16:10 deraadt Exp $ */ /* * This program is in the public domain and may be used freely by anyone @@ -35,7 +35,6 @@ #include "identd.h" #include "error.h" -extern char *version; extern char *__progname; int verbose_flag = 0; @@ -64,7 +63,7 @@ usage(void) { syslog(LOG_ERR, "%s [-i | -w | -b] [-t seconds] [-u uid] [-g gid] [-p port] " - "[-a address] [-c charset] [-noelVvmNUdh]", __progname); + "[-a address] [-c charset] [-noelvmNUdh]", __progname); exit(2); } @@ -113,9 +112,9 @@ gethost6(struct sockaddr_in6 *addr) #else const int niflags = NI_NUMERICHOST; #endif - static int bb=0; + static int bb = 0; int error; - + bb = (bb+1)%2; error = getnameinfo((struct sockaddr *)addr, addr->sin6_len, hbuf[bb], sizeof(hbuf[bb]), NULL, 0, niflags); @@ -144,7 +143,7 @@ int main(int argc, char *argv[]) { struct sockaddr_storage sa, sa2; - /* struct sockaddr_in sin;*/ + /* struct sockaddr_in sin;*/ struct sockaddr_in *sin; struct sockaddr_in6 *sin6; struct in_addr laddr, faddr; @@ -163,7 +162,7 @@ main(int argc, char *argv[]) /* * Parse the command line arguments */ - while ((ch = getopt(argc, argv, "hbwit:p:a:u:g:c:r:loenVvdmNU")) != -1) { + while ((ch = getopt(argc, argv, "hbwit:p:a:u:g:c:r:loenvdmNU")) != -1) { switch (ch) { case 'h': token_flag = 1; @@ -233,10 +232,6 @@ main(int argc, char *argv[]) case 'n': number_flag = 1; break; - case 'V': /* Give version of this daemon */ - (void)fprintf(stderr, "[identd version %s]\r\n", version); - exit(0); - break; case 'v': /* Be verbose */ verbose_flag++; break; @@ -346,7 +341,7 @@ main(int argc, char *argv[]) signal(SIGALRM, alarm_handler); alarm(timeout); } - + /* * Wait for a connection request to occur. * Ignore EINTR (Interrupted System Call). diff --git a/libexec/identd/openbsd.c b/libexec/identd/openbsd.c index 15b18a10fdc..363bee2b2fb 100644 --- a/libexec/identd/openbsd.c +++ b/libexec/identd/openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openbsd.c,v 1.16 2002/06/22 20:34:31 deraadt Exp $ */ +/* $OpenBSD: openbsd.c,v 1.17 2002/07/16 10:16:10 deraadt Exp $ */ /* * This program is in the public domain and may be used freely by anyone @@ -52,7 +52,7 @@ k_getuid(struct in_addr *faddr, int fport, struct in_addr *laddr, tir.laddr.ss_family = AF_INET; fin = (struct sockaddr_in *) &tir.faddr; lin = (struct sockaddr_in *) &tir.laddr; - + memcpy(&fin->sin_addr, faddr, sizeof (struct in_addr)); memcpy(&lin->sin_addr, laddr, sizeof (struct in_addr)); fin->sin_port = fport; @@ -87,7 +87,7 @@ k_getuid6(struct sockaddr_in6 *faddr, int fport, struct sockaddr_in6 *laddr, memset(&tir, 0, sizeof (tir)); fin = (struct sockaddr_in6 *) &tir.faddr; lin = (struct sockaddr_in6 *) &tir.laddr; - + if (faddr->sin6_len > sizeof(tir.faddr)) return -1; memcpy(fin, faddr, faddr->sin6_len); diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c index 2a3eb3233dc..3b2148b34d4 100644 --- a/libexec/identd/parse.c +++ b/libexec/identd/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.30 2002/06/22 20:34:31 deraadt Exp $ */ +/* $OpenBSD: parse.c,v 1.31 2002/07/16 10:16:10 deraadt Exp $ */ /* * This program is in the public domain and may be used freely by anyone @@ -61,10 +61,9 @@ check_noident(char *homedir) int getuserident(char *homedir, char *buf, int len) { - char path[MAXPATHLEN]; + char path[MAXPATHLEN], *p; struct stat st; int fd, nread; - char *p; if (len == 0) return 0; @@ -188,7 +187,7 @@ parse(int fd, struct in_addr *laddr, struct in_addr *faddr) uid_t uid; if (debug_flag && syslog_flag) - syslog(LOG_DEBUG, "In function parse(), from %s to %s", + syslog(LOG_DEBUG, "In function parse(), from %s to %s", gethost4_addr(faddr), gethost4_addr(laddr)); if (debug_flag && syslog_flag) @@ -250,7 +249,7 @@ parse(int fd, struct in_addr *laddr, struct in_addr *faddr) if (k_getuid(&faddr2, htons(fport), laddr, htons(lport), &uid) == -1) { if (syslog_flag) - syslog(LOG_DEBUG, "Returning: %d , %d : NO-USER", + syslog(LOG_DEBUG, "Returning: %d , %d : NO-USER", lport, fport); n = snprintf(buf, sizeof(buf), "%d , %d : ERROR : %s\r\n", lport, fport, unknown_flag ? "UNKNOWN-ERROR" : "NO-USER"); @@ -356,7 +355,7 @@ parse6(int fd, struct sockaddr_in6 *laddr, struct sockaddr_in6 *faddr) uid_t uid; if (debug_flag && syslog_flag) - syslog(LOG_DEBUG, "In function parse6(), from %s to %s", + syslog(LOG_DEBUG, "In function parse6(), from %s to %s", gethost6(faddr), gethost6(laddr)); if (debug_flag && syslog_flag) @@ -418,7 +417,7 @@ parse6(int fd, struct sockaddr_in6 *laddr, struct sockaddr_in6 *faddr) if (k_getuid6(&faddr2, htons(fport), laddr, htons(lport), &uid) == -1) { if (syslog_flag) - syslog(LOG_DEBUG, "Returning: %d , %d : NO-USER", + syslog(LOG_DEBUG, "Returning: %d , %d : NO-USER", lport, fport); n = snprintf(buf, sizeof(buf), "%d , %d : ERROR : %s\r\n", lport, fport, unknown_flag ? "UNKNOWN-ERROR" : "NO-USER"); diff --git a/libexec/identd/version.c b/libexec/identd/version.c deleted file mode 100644 index 9e11de16c4b..00000000000 --- a/libexec/identd/version.c +++ /dev/null @@ -1,2 +0,0 @@ -/* $OpenBSD: version.c,v 1.2 2001/01/28 19:34:29 niklas Exp $ */ -char *version = "2.1.2"; |