X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/ad7871609881e73855d0b04da49b486cd93efca7..ed554bc5e4201344d7eaad78263566e79428759c:/usr/src/libexec/rshd/rshd.c diff --git a/usr/src/libexec/rshd/rshd.c b/usr/src/libexec/rshd/rshd.c index 0163da960c..1b9eea9e1e 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. * * Redistribution and use in source and binary forms, with or without @@ -33,12 +33,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) 6/4/93"; +static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; #endif /* not lint */ /* @@ -58,16 +58,16 @@ static char sccsid[] = "@(#)rshd.c 8.1 (Berkeley) 6/4/93"; #include #include +#include #include -#include +#include #include -#include -#include -#include +#include #include #include #include -#include +#include +#include int keepalive = 1; int check_all; @@ -140,7 +140,7 @@ main(argc, argv) case '?': default: usage(); - exit(2); + break; } argc -= optind; @@ -654,7 +654,7 @@ fail: 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 @@ -761,8 +761,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--) { @@ -778,5 +777,7 @@ topdomain(h) void usage() { + syslog(LOG_ERR, "usage: rshd [-%s]", OPTIONS); + exit(2); }