[BACK]Return to rsh.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rsh

Diff for /src/usr.bin/rsh/Attic/rsh.c between version 1.7 and 1.8

version 1.7, 1996/08/11 08:46:44 version 1.8, 1996/08/30 02:20:57
Line 101 
Line 101 
         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];
Line 177 
Line 177 
         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);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8