summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-16 10:32:38 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-16 10:32:38 +0000
commit3c3d1baf1c50712cc4b4595b51cd48e6b8b476c0 (patch)
treeacf9efafa00be65efc97299f2935b6764597c76d
parentdfa8ced20dbdcadc73924aa3af010d16fd49b669 (diff)
minor tweaks of no consequence
-rw-r--r--libexec/identd/openbsd.c12
-rw-r--r--libexec/identd/parse.c24
2 files changed, 14 insertions, 22 deletions
diff --git a/libexec/identd/openbsd.c b/libexec/identd/openbsd.c
index 363bee2b2fb..631a33370c8 100644
--- a/libexec/identd/openbsd.c
+++ b/libexec/identd/openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openbsd.c,v 1.17 2002/07/16 10:16:10 deraadt Exp $ */
+/* $OpenBSD: openbsd.c,v 1.18 2002/07/16 10:32:37 deraadt Exp $ */
/*
* This program is in the public domain and may be used freely by anyone
@@ -31,7 +31,6 @@
#include "identd.h"
#include "error.h"
-
/*
* Return the user number for the connection owner
*/
@@ -39,9 +38,9 @@ int
k_getuid(struct in_addr *faddr, int fport, struct in_addr *laddr,
int lport, uid_t *uid)
{
- struct tcp_ident_mapping tir;
- struct sockaddr_in *fin, *lin;
int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT };
+ struct sockaddr_in *fin, *lin;
+ struct tcp_ident_mapping tir;
int error = 0;
size_t i;
@@ -69,7 +68,6 @@ k_getuid(struct in_addr *faddr, int fport, struct in_addr *laddr,
return (-1);
}
-
/*
* Return the user number for the connection owner
* New minty IPv6 version.
@@ -78,9 +76,9 @@ int
k_getuid6(struct sockaddr_in6 *faddr, int fport, struct sockaddr_in6 *laddr,
int lport, uid_t *uid)
{
- struct tcp_ident_mapping tir;
- struct sockaddr_in6 *fin, *lin;
int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT };
+ struct sockaddr_in6 *fin, *lin;
+ struct tcp_ident_mapping tir;
int error = 0;
size_t i;
diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c
index 168eaf6658c..811928588a1 100644
--- a/libexec/identd/parse.c
+++ b/libexec/identd/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.32 2002/07/16 10:21:20 deraadt Exp $ */
+/* $OpenBSD: parse.c,v 1.33 2002/07/16 10:32:37 deraadt Exp $ */
/*
* This program is in the public domain and may be used freely by anyone
@@ -61,8 +61,8 @@ int
getuserident(char *homedir, char *buf, int len)
{
char path[MAXPATHLEN], *p;
- struct stat st;
int fd, nread;
+ struct stat st;
if (len == 0)
return 0;
@@ -116,10 +116,10 @@ gentoken(char *buf, int len)
ssize_t
timed_read(int fd, void *buf, size_t siz, time_t timeout)
{
+ struct timeval tv, start, after, duration, tmp;
int error, tot = 0, i, r;
- char *p = buf;
struct pollfd rfd[1];
- struct timeval tv, start, after, duration, tmp;
+ char *p = buf;
tv.tv_sec = timeout;
tv.tv_usec = 0;
@@ -158,9 +158,9 @@ timed_read(int fd, void *buf, size_t siz, time_t timeout)
ssize_t
timed_write(int fd, const void *buf, size_t siz, time_t timeout)
{
- int error;
struct pollfd wfd[2];
struct timeval tv;
+ int error;
wfd[0].fd = fd;
wfd[0].events = POLLOUT;
@@ -178,19 +178,16 @@ timed_write(int fd, const void *buf, size_t siz, time_t timeout)
int
parse(int fd, struct in_addr *laddr, struct in_addr *faddr)
{
- char token[21];
- char buf[BUFSIZ], *p;
+ char token[21], buf[BUFSIZ], *p;
struct in_addr laddr2, faddr2;
struct passwd *pw;
- int n;
uid_t uid;
+ int n;
if (debug_flag && syslog_flag)
syslog(LOG_DEBUG, "In function parse(), from %s to %s",
gethost4_addr(faddr), gethost4_addr(laddr));
- if (debug_flag && syslog_flag)
- syslog(LOG_DEBUG, " Before read from remote host");
faddr2 = *faddr;
laddr2 = *laddr;
lport = fport = 0;
@@ -346,19 +343,16 @@ parse(int fd, struct in_addr *laddr, struct in_addr *faddr)
int
parse6(int fd, struct sockaddr_in6 *laddr, struct sockaddr_in6 *faddr)
{
- char token[21];
- char buf[BUFSIZ], *p;
+ char token[21], buf[BUFSIZ], *p;
struct sockaddr_in6 laddr2, faddr2;
struct passwd *pw;
- int n;
uid_t uid;
+ int n;
if (debug_flag && syslog_flag)
syslog(LOG_DEBUG, "In function parse6(), from %s to %s",
gethost6(faddr), gethost6(laddr));
- if (debug_flag && syslog_flag)
- syslog(LOG_DEBUG, " Before read from remote host");
faddr2 = *faddr;
laddr2 = *laddr;
lport = fport = 0;