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

Diff for /src/usr.bin/oldrdist/Attic/main.c between version 1.2 and 1.3

version 1.2, 1996/06/26 05:37:39 version 1.3, 1996/07/19 21:57:33
Line 98 
Line 98 
         gethostname(host, sizeof(host));          gethostname(host, sizeof(host));
         strcpy(tempfile, _PATH_TMP);          strcpy(tempfile, _PATH_TMP);
         strcat(tempfile, _RDIST_TMP);          strcat(tempfile, _RDIST_TMP);
         if ((tempname = rindex(tempfile, '/')) != 0)          tempname = xbasename(tempfile);
                 tempname++;  
         else  
                 tempname = tempfile;  
   
         while (--argc > 0) {          while (--argc > 0) {
                 if ((arg = *++argv)[0] != '-')                  if ((arg = *++argv)[0] != '-')
Line 192 
Line 189 
         }          }
         *hp = NULL;          *hp = NULL;
   
   #if     defined(DIRECT_RCMD)
         seteuid(userid);          seteuid(userid);
   #else   /* DIRECT_RCMD */
           if (!iamremote && getuid() != geteuid()) {
                   error("This version of rdist should not be installed setuid.\n");
                   exit(1);
           }
   #endif  /* DIRECT_RCMD */
         mktemp(tempfile);          mktemp(tempfile);
   
         if (iamremote) {          if (iamremote) {
Line 209 
Line 213 
                                         fin = fopen("Distfile", "r");                                          fin = fopen("Distfile", "r");
                         } else                          } else
                                 fin = fopen(distfile, "r");                                  fin = fopen(distfile, "r");
                         if(fin == NULL) {                          if (fin == NULL) {
                                 perror(distfile ? distfile : "distfile");                                  perror(distfile ? distfile : "distfile");
                                 exit(1);                                  exit(1);
                         }                          }
Line 261 
Line 265 
         }          }
   
         cp = args[i];          cp = args[i];
         if ((dest = index(cp, ':')) != NULL)          if ((dest = strchr(cp, ':')) != NULL)
                 *dest++ = '\0';                  *dest++ = '\0';
         tnl.n_name = cp;          tnl.n_name = cp;
         hosts = expand(&tnl, E_ALL);          hosts = expand(&tnl, E_ALL);
Line 327 
Line 331 
         (void)vfprintf(stderr, fmt, ap);          (void)vfprintf(stderr, fmt, ap);
         (void)fprintf(stderr, "\n");          (void)fprintf(stderr, "\n");
         va_end(ap);          va_end(ap);
   }
   
   /*
    * Private version of basename()
    */
   char *xbasename(path)
           char *path;
   {
           register char *cp;
   
           if (cp = strrchr(path, '/'))
                   return(cp+1);
           else
                   return(path);
 }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3