X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/2c3d5b80222f2f6885143fbd86bfb08e14589cc6..8b0826c18f8e49149d5471ecef1b03c18167e8b2:/usr/src/libexec/rshd/rshd.c diff --git a/usr/src/libexec/rshd/rshd.c b/usr/src/libexec/rshd/rshd.c index 59e76eb008..228845b993 100644 --- a/usr/src/libexec/rshd/rshd.c +++ b/usr/src/libexec/rshd/rshd.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1988, 1989, 1992, 1993 + * Copyright (c) 1988, 1989, 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. * * %sccs.include.redist.c% @@ -7,12 +7,12 @@ #ifndef lint static char copyright[] = -"@(#) Copyright (c) 1988, 1989, 1992, 1993\n\ +"@(#) Copyright (c) 1988, 1989, 1992, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)rshd.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /* @@ -32,17 +32,16 @@ static char sccsid[] = "@(#)rshd.c 8.1 (Berkeley) %G%"; #include #include +#include #include -#include +#include #include -#include -#include "pathnames.h" -#include -#include +#include #include #include #include -#include +#include +#include int keepalive = 1; int check_all = 0; @@ -84,7 +83,7 @@ main(argc, argv) case '?': default: usage(); - exit(2); + break; } argc -= optind; @@ -421,7 +420,7 @@ doit(fromp) strcat(path, _PATH_DEFPATH); strncat(shell, pwd->pw_shell, sizeof(shell)-7); strncat(username, pwd->pw_name, sizeof(username)-6); - cp = rindex(pwd->pw_shell, '/'); + cp = strrchr(pwd->pw_shell, '/'); if (cp) cp++; else @@ -557,8 +556,7 @@ char * topdomain(h) char *h; { - register char *p; - char *maybe = NULL; + char *p, *maybe = NULL; int dots = 0; for (p = h + strlen(h); p >= h; p--) { @@ -574,5 +572,7 @@ topdomain(h) void usage() { + syslog(LOG_ERR, "usage: rshd [-%s]", OPTIONS); + exit(2); }