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

Diff for /src/usr.bin/rdistd/server.c between version 1.10 and 1.11

version 1.10, 2001/11/19 19:02:15 version 1.11, 2003/04/05 20:31:58
Line 221 
Line 221 
                         } else {                          } else {
                                 uid      = last_uid      = pw->pw_uid;                                  uid      = last_uid      = pw->pw_uid;
                                 primegid = last_primegid = pw->pw_gid;                                  primegid = last_primegid = pw->pw_gid;
                                 strcpy(last_owner, owner);                                  strlcpy(last_owner, owner, sizeof last_owner);
                         }                          }
                 } else {                  } else {
                         uid = last_uid;                          uid = last_uid;
Line 253 
Line 253 
                  */                   */
                 if ((gr = mygetgroup(group))) {                  if ((gr = mygetgroup(group))) {
                         last_gid = gid = gr->gr_gid;                          last_gid = gid = gr->gr_gid;
                         strcpy(last_group, gr->gr_name);                          strlcpy(last_group, gr->gr_name, sizeof last_group);
                 } else {                  } else {
                         if (mode != -1 && IS_ON(mode, S_ISGID)) {                          if (mode != -1 && IS_ON(mode, S_ISGID)) {
                                 message(MT_NOTICE,                                  message(MT_NOTICE,
Line 528 
Line 528 
                         if (env == NULL) {                          if (env == NULL) {
                                 len = (2 * sizeof(E_FILES)) + strlen(cp) + 10;                                  len = (2 * sizeof(E_FILES)) + strlen(cp) + 10;
                                 env = (char *) xmalloc(len);                                  env = (char *) xmalloc(len);
                                 (void) sprintf(env, "export %s;%s=%s",                                  (void) snprintf(env, len, "export %s;%s=%s",
                                                E_FILES, E_FILES, cp);                                                 E_FILES, E_FILES, cp);
                         } else {                          } else {
                                 len = strlen(env);                                  len = strlen(env);
                                 env = (char *) xrealloc(env,                                  env = (char *) xrealloc(env,
                                                         len + strlen(cp) + 2);                                      len + strlen(cp) + 2);
                                 env[len] = CNULL;                                  env[len] = CNULL;
                                 (void) strcat(env, ":");                                  (void) strcat(env, ":");
                                 (void) strcat(env, cp);                                  (void) strcat(env, cp);
Line 710 
Line 710 
                 return(NULL);                  return(NULL);
         }          }
   
         (void) sprintf(savefile, "%s%s", file, SAVE_SUFFIX);          (void) snprintf(savefile, sizeof savefile, "%s%s", file, SAVE_SUFFIX);
   
         if (unlink(savefile) != 0 && errno != ENOENT) {          if (unlink(savefile) != 0 && errno != ENOENT) {
                 message(MT_NOTICE, "%s: remove failed: %s", savefile, SYSERR);                  message(MT_NOTICE, "%s: remove failed: %s", savefile, SYSERR);
Line 1045 
Line 1045 
                                         opts;                                          opts;
                                 if ((cp = getusername(stb.st_uid, target, o)))                                  if ((cp = getusername(stb.st_uid, target, o)))
                                         if (strcmp(owner, cp))                                          if (strcmp(owner, cp))
                                                 (void) strcpy(lowner, cp);                                                  (void) strlcpy(lowner, cp,
                                                       sizeof lowner);
                         }                          }
                         if (!IS_ON(opts, DO_NOCHKGROUP) && group) {                          if (!IS_ON(opts, DO_NOCHKGROUP) && group) {
                                 int o;                                  int o;
Line 1054 
Line 1055 
                                         opts;                                          opts;
                                 if ((cp = getgroupname(stb.st_gid, target, o)))                                  if ((cp = getgroupname(stb.st_gid, target, o)))
                                         if (strcmp(group, cp))                                          if (strcmp(group, cp))
                                                 (void) strcpy(lgroup, cp);                                                  (void) strlcpy(lgroup, cp,
                                                       sizeof lgroup);
                         }                          }
   
                         /*                          /*
Line 1065 
Line 1067 
                                 if (lowner[0] == CNULL &&                                  if (lowner[0] == CNULL &&
                                     (cp = getusername(stb.st_uid,                                      (cp = getusername(stb.st_uid,
                                                       target, opts)))                                                        target, opts)))
                                         (void) strcpy(lowner, cp);                                          (void) strlcpy(lowner, cp,
                                               sizeof lowner);
                                 if (lgroup[0] == CNULL &&                                  if (lgroup[0] == CNULL &&
                                     (cp = getgroupname(stb.st_gid,                                      (cp = getgroupname(stb.st_gid,
                                                        target, opts)))                                                         target, opts)))
                                         (void) strcpy(lgroup, cp);                                          (void) strlcpy(lgroup, cp,
                                               sizeof lgroup);
   
                                 if (IS_ON(opts, DO_VERIFY))                                  if (IS_ON(opts, DO_VERIFY))
                                         message(MT_NOTICE,                                          message(MT_NOTICE,
Line 1469 
Line 1473 
                 }                  }
                 file = strrchr(target, '/');                  file = strrchr(target, '/');
                 if (file == NULL)                  if (file == NULL)
                         (void) strcpy(new, tempname);                          (void) strlcpy(new, tempname, sizeof new);
                 else if (file == target)                  else if (file == target)
                         (void) sprintf(new, "/%s", tempname);                          (void) snprintf(new, sizeof new, "/%s", tempname);
                 else {                  else {
                         *file = CNULL;                          *file = CNULL;
                         (void) sprintf(new, "%s/%s", target, tempname);                          (void) snprintf(new, sizeof new, "%s/%s", target, tempname);
                         *file = '/';                          *file = '/';
                 }                  }
                 (void) mktemp(new);                  (void) mktemp(new);
Line 1596 
Line 1600 
         (void) signal(SIGTERM, sighandler);          (void) signal(SIGTERM, sighandler);
         (void) signal(SIGPIPE, sighandler);          (void) signal(SIGPIPE, sighandler);
         (void) umask(oumask = umask(0));          (void) umask(oumask = umask(0));
         (void) strcpy(tempname, _RDIST_TMP);          (void) strlcpy(tempname, _RDIST_TMP, sizeof tempname);
         if (fromhost) {          if (fromhost) {
                 message(MT_SYSLOG, "Startup for %s", fromhost);                  message(MT_SYSLOG, "Startup for %s", fromhost);
 #if     defined(SETARGS)  #if     defined(SETARGS)

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11