version 1.7, 1996/08/11 08:46:44 |
version 1.8, 1996/08/30 02:20:57 |
|
|
host = user = NULL; |
host = user = NULL; |
|
|
/* if called as something other than "rsh", use it as the host name */ |
/* if called as something other than "rsh", use it as the host name */ |
if (p = rindex(argv[0], '/')) |
if (p = strrchr(argv[0], '/')) |
++p; |
++p; |
else |
else |
p = argv[0]; |
p = argv[0]; |
|
|
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
|
|
|
if (geteuid()) { |
|
(void)fprintf(stderr, "rsh: must be setuid root.\n"); |
|
exit(1); |
|
} |
if (!(pw = getpwuid(uid = getuid()))) { |
if (!(pw = getpwuid(uid = getuid()))) { |
(void)fprintf(stderr, "rsh: unknown user id.\n"); |
(void)fprintf(stderr, "rsh: unknown user id.\n"); |
exit(1); |
exit(1); |