summaryrefslogtreecommitdiff
path: root/libexec/identd
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/identd')
-rw-r--r--libexec/identd/identd.c59
-rw-r--r--libexec/identd/openbsd.c5
-rw-r--r--libexec/identd/proxy.c1
3 files changed, 17 insertions, 48 deletions
diff --git a/libexec/identd/identd.c b/libexec/identd/identd.c
index cf5a7157f2c..67332176087 100644
--- a/libexec/identd/identd.c
+++ b/libexec/identd/identd.c
@@ -99,7 +99,8 @@ main(argc, argv)
struct sockaddr_in sin;
struct in_addr laddr, faddr;
struct timeval tv;
-
+ struct passwd *pwd;
+ struct group *grp;
int background_flag = 0;
int timeout = 0;
char *portno = "113";
@@ -117,98 +118,76 @@ main(argc, argv)
case 'b': /* Start as standalone daemon */
background_flag = 1;
break;
-
case 'w': /* Start from Inetd, wait mode */
background_flag = 2;
break;
-
case 'i': /* Start from Inetd, nowait mode */
background_flag = 0;
break;
-
case 't':
timeout = atoi(argv[i] + 2);
break;
-
case 'p':
portno = argv[i] + 2;
break;
-
case 'a':
bind_address = argv[i] + 2;
break;
-
case 'u':
- if (isdigit(argv[i][2]))
+ if (isdigit(argv[i][2])) {
set_uid = atoi(argv[i] + 2);
+ break;
+ }
+ pwd = getpwnam(argv[i] + 2);
+ if (!pwd)
+ ERROR1("no such user (%s) for -u option", argv[i] + 2);
else {
- struct passwd *pwd;
-
- pwd = getpwnam(argv[i] + 2);
- if (!pwd)
- ERROR1("no such user (%s) for -u option", argv[i] + 2);
- else {
- set_uid = pwd->pw_uid;
- set_gid = pwd->pw_gid;
- }
+ set_uid = pwd->pw_uid;
+ set_gid = pwd->pw_gid;
}
break;
-
case 'g':
- if (isdigit(argv[i][2]))
+ if (isdigit(argv[i][2])) {
set_gid = atoi(argv[i] + 2);
- else {
- struct group *grp;
-
- grp = getgrnam(argv[i] + 2);
- if (!grp)
- ERROR1("no such group (%s) for -g option", argv[i] + 2);
- else
- set_gid = grp->gr_gid;
+ break;
}
+ grp = getgrnam(argv[i] + 2);
+ if (!grp)
+ ERROR1("no such group (%s) for -g option", argv[i] + 2);
+ else
+ set_gid = grp->gr_gid;
break;
-
case 'c':
charset_name = argv[i] + 2;
break;
-
case 'r':
indirect_host = argv[i] + 2;
break;
-
case 'l': /* Use the Syslog daemon for logging */
syslog_flag++;
break;
-
case 'o':
other_flag = 1;
break;
-
case 'e':
unknown_flag = 1;
break;
-
case 'n':
number_flag = 1;
break;
-
case 'V': /* Give version of this daemon */
printf("[in.identd, version %s]\r\n", version);
exit(0);
break;
-
case 'v': /* Be verbose */
verbose_flag++;
break;
-
case 'd': /* Enable debugging */
debug_flag++;
break;
-
case 'm': /* Enable multiline queries */
multi_flag++;
break;
-
case 'N': /* Enable users ".noident" files */
noident_flag++;
break;
@@ -241,7 +220,6 @@ main(argc, argv)
struct servent *sp;
int fd;
-
if (fork())
exit(0);
@@ -311,7 +289,6 @@ main(argc, argv)
int nfds, fd;
fd_set read_set;
-
/*
* Loop and dispatch client handling processes
*/
@@ -399,7 +376,6 @@ main(argc, argv)
}
faddr = sin.sin_addr;
-
/*
* Open the connection to the Syslog daemon if requested
*/
@@ -409,7 +385,6 @@ main(argc, argv)
#else
openlog("identd", LOG_PID);
#endif
-
syslog(LOG_INFO, "Connection from %s", gethost(&faddr));
}
/*
diff --git a/libexec/identd/openbsd.c b/libexec/identd/openbsd.c
index f28348b4296..520bba13ed4 100644
--- a/libexec/identd/openbsd.c
+++ b/libexec/identd/openbsd.c
@@ -75,7 +75,6 @@ k_open()
return 0;
}
-
/*
* Get a piece of kernel memory with error handling.
* Returns 1 if call succeeded, else 0 (zero).
@@ -97,8 +96,6 @@ getbuf(addr, buf, len, what)
return 1;
}
-
-
/*
* Traverse the inpcb list until a match is found.
* Returns NULL if no match.
@@ -129,8 +126,6 @@ getlist(tcbtablep, ktcbtablep, faddr, fport, laddr, lport)
return (NULL);
}
-
-
/*
* Return the user number for the connection owner
*/
diff --git a/libexec/identd/proxy.c b/libexec/identd/proxy.c
index d6c23f5f937..9dc7db8c695 100644
--- a/libexec/identd/proxy.c
+++ b/libexec/identd/proxy.c
@@ -18,7 +18,6 @@
#include <ident.h>
#endif
-
/*
* This function should establish a connection to a remote IDENT
* server and query it for the information associated with the