diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-03 23:27:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-03 23:27:20 +0000 |
commit | 36456482c1cfc26d8aa16c0acb028021e66f62cc (patch) | |
tree | d1305f793ba779ff3dcd4efec669afb927cb208f /libexec | |
parent | 6a37eefb47356c0634d3a6a25b3a9bfed0318260 (diff) |
ansi on a file which idiots believe is not here anymore
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rshd/rshd.c | 65 |
1 files changed, 29 insertions, 36 deletions
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index dc138e05f6a..6f09dd9012c 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rshd.c,v 1.46 2002/05/26 09:32:08 deraadt Exp $ */ +/* $OpenBSD: rshd.c,v 1.47 2002/07/03 23:27:19 deraadt Exp $ */ /*- * Copyright (c) 1988, 1989, 1992, 1993, 1994 @@ -41,7 +41,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */ -static char *rcsid = "$OpenBSD: rshd.c,v 1.46 2002/05/26 09:32:08 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rshd.c,v 1.47 2002/07/03 23:27:19 deraadt Exp $"; #endif /* not lint */ /* @@ -119,9 +119,7 @@ void desrw_set_key(des_cblock *, des_key_schedule *); #endif int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { extern int __check_rhosts_file; struct linger linger; @@ -205,8 +203,7 @@ char *envinit[1] = { 0 }; extern char **environ; void -doit(fromp) - struct sockaddr *fromp; +doit(struct sockaddr *fromp) { extern char *__rcmd_errstr; /* syslog hook from libc/net/rcmd.c. */ struct addrinfo hints, *res, *res0; @@ -284,29 +281,29 @@ doit(fromp) } #ifdef IP_OPTIONS - if (fromp->sa_family == AF_INET) - { - struct ipoption opts; - int optsize = sizeof(opts), ipproto, i; - struct protoent *ip; - - if ((ip = getprotobyname("ip")) != NULL) - ipproto = ip->p_proto; - else - ipproto = IPPROTO_IP; - if (!getsockopt(0, ipproto, IP_OPTIONS, (char *)&opts, &optsize) && - optsize != 0) { - for (i = 0; (void *)&opts.ipopt_list[i] - (void *)&opts < - optsize; ) { - u_char c = (u_char)opts.ipopt_list[i]; - if (c == IPOPT_LSRR || c == IPOPT_SSRR) - exit(1); - if (c == IPOPT_EOL) - break; - i += (c == IPOPT_NOP) ? 1 : (u_char)opts.ipopt_list[i+1]; + if (fromp->sa_family == AF_INET) { + struct ipoption opts; + int optsize = sizeof(opts), ipproto, i; + struct protoent *ip; + + if ((ip = getprotobyname("ip")) != NULL) + ipproto = ip->p_proto; + else + ipproto = IPPROTO_IP; + if (!getsockopt(0, ipproto, IP_OPTIONS, (char *)&opts, + &optsize) && optsize != 0) { + for (i = 0; (void *)&opts.ipopt_list[i] - (void *)&opts < + optsize; ) { + u_char c = (u_char)opts.ipopt_list[i]; + if (c == IPOPT_LSRR || c == IPOPT_SSRR) + exit(1); + if (c == IPOPT_EOL) + break; + i += (c == IPOPT_NOP) ? 1 : + (u_char)opts.ipopt_list[i+1]; + } } } - } #endif #ifdef KERBEROS @@ -794,9 +791,7 @@ error(const char *fmt, ...) } void -getstr(buf, cnt, err) - char *buf, *err; - int cnt; +getstr(char *buf, int cnt, char *err) { char c; @@ -820,8 +815,7 @@ getstr(buf, cnt, err) * interpreted as such. */ int -local_domain(h) - char *h; +local_domain(char *h) { char localhost[MAXHOSTNAMELEN]; char *p1, *p2; @@ -836,8 +830,7 @@ local_domain(h) } char * -topdomain(h) - char *h; +topdomain(char *h) { char *p, *maybe = NULL; int dots = 0; @@ -853,7 +846,7 @@ topdomain(h) } void -usage() +usage(void) { syslog(LOG_ERR, "usage: rshd [-%s]", OPTIONS); |