=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsh/Attic/rsh.c,v retrieving revision 1.7 retrieving revision 1.8 diff -c -r1.7 -r1.8 *** src/usr.bin/rsh/Attic/rsh.c 1996/08/11 08:46:44 1.7 --- src/usr.bin/rsh/Attic/rsh.c 1996/08/30 02:20:57 1.8 *************** *** 1,4 **** ! /* $OpenBSD: rsh.c,v 1.7 1996/08/11 08:46:44 tholo Exp $ */ /*- * Copyright (c) 1983, 1990 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: rsh.c,v 1.8 1996/08/30 02:20:57 millert Exp $ */ /*- * Copyright (c) 1983, 1990 The Regents of the University of California. *************** *** 41,47 **** #ifndef lint /*static char sccsid[] = "from: @(#)rsh.c 5.24 (Berkeley) 7/1/91";*/ ! static char rcsid[] = "$OpenBSD: rsh.c,v 1.7 1996/08/11 08:46:44 tholo Exp $"; #endif /* not lint */ #include --- 41,47 ---- #ifndef lint /*static char sccsid[] = "from: @(#)rsh.c 5.24 (Berkeley) 7/1/91";*/ ! static char rcsid[] = "$OpenBSD: rsh.c,v 1.8 1996/08/30 02:20:57 millert Exp $"; #endif /* not lint */ #include *************** *** 101,107 **** host = user = NULL; /* if called as something other than "rsh", use it as the host name */ ! if (p = rindex(argv[0], '/')) ++p; else p = argv[0]; --- 101,107 ---- host = user = NULL; /* if called as something other than "rsh", use it as the host name */ ! if (p = strrchr(argv[0], '/')) ++p; else p = argv[0]; *************** *** 177,182 **** --- 177,186 ---- argc -= optind; argv += optind; + if (geteuid()) { + (void)fprintf(stderr, "rsh: must be setuid root.\n"); + exit(1); + } if (!(pw = getpwuid(uid = getuid()))) { (void)fprintf(stderr, "rsh: unknown user id.\n"); exit(1);