[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.36 and 1.37

version 1.36, 2004/01/17 21:42:48 version 1.37, 2005/04/01 04:06:40
Line 77 
Line 77 
         struct passwd *pw;          struct passwd *pw;
         struct servent *sp;          struct servent *sp;
         sigset_t mask, omask;          sigset_t mask, omask;
         int argoff, asrsh, ch, dflag, nflag, one, rem, uid;          int argoff = 0, asrsh = 0, ch, dflag = 0, nflag = 0, one = 1, rem, uid;
         char *args, *host, *user;          char *args, *host = NULL, *user = NULL;
         pid_t pid = 0;          pid_t pid = 0;
         extern char *__progname;          extern char *__progname;
   
         argoff = asrsh = dflag = nflag = 0;  
         one = 1;  
         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 (strcmp(__progname, "rsh") != 0)          if (strcmp(__progname, "rsh") != 0)
                 host = __progname;                  host = __progname;
Line 155 
Line 151 
             PF_UNSPEC);              PF_UNSPEC);
         if (rem < 0)          if (rem < 0)
                 exit(1);                  exit(1);
   
         if (rfd2 < 0)          if (rfd2 < 0)
                 errx(1, "can't establish stderr");                  errx(1, "can't establish stderr");
   
           (void)seteuid(uid);
           (void)setuid(uid);
   
         if (dflag) {          if (dflag) {
                 if (setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one,                  if (setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one,
                     sizeof(one)) < 0)                      sizeof(one)) < 0)
Line 166 
Line 165 
                     sizeof(one)) < 0)                      sizeof(one)) < 0)
                         warn("setsockopt");                          warn("setsockopt");
         }          }
   
         (void)seteuid(uid);  
         (void)setuid(uid);  
         sigemptyset(&mask);          sigemptyset(&mask);
         sigaddset(&mask, SIGINT);          sigaddset(&mask, SIGINT);
         sigaddset(&mask, SIGQUIT);          sigaddset(&mask, SIGQUIT);

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37