[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.33 and 1.34

version 1.33, 2014/07/12 03:10:03 version 1.34, 2015/01/16 06:40:11
Line 39 
Line 39 
   
 char    tempname[sizeof _RDIST_TMP + 1]; /* Tmp file name */  char    tempname[sizeof _RDIST_TMP + 1]; /* Tmp file name */
 char    buf[BUFSIZ];            /* general purpose buffer */  char    buf[BUFSIZ];            /* general purpose buffer */
 char    target[MAXPATHLEN];     /* target/source directory name */  char    target[PATH_MAX];       /* target/source directory name */
 char    *ptarget;               /* pointer to end of target name */  char    *ptarget;               /* pointer to end of target name */
 int     catname = 0;            /* cat name to target name */  int     catname = 0;            /* cat name to target name */
 char    *sptarget[32];          /* stack of saved ptarget's for directories */  char    *sptarget[32];          /* stack of saved ptarget's for directories */
Line 324 
Line 324 
                     (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))                      (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
                         continue;                          continue;
   
                 if (len + 1 + (int)strlen(dp->d_name) >= MAXPATHLEN - 1) {                  if (len + 1 + (int)strlen(dp->d_name) >= PATH_MAX - 1) {
                         if (!silent)                          if (!silent)
                                 message(MT_REMOTE|MT_WARNING,                                  message(MT_REMOTE|MT_WARNING,
                                         "%s/%s: Name too long",                                          "%s/%s: Name too long",
Line 387 
Line 387 
         char *optarget, *ep;          char *optarget, *ep;
         int len;          int len;
         opt_t opts;          opt_t opts;
         char targ[MAXPATHLEN*4];          char targ[PATH_MAX*4];
   
         opts = strtol(cp, &ep, 8);          opts = strtol(cp, &ep, 8);
         if (*ep != CNULL) {          if (*ep != CNULL) {
Line 407 
Line 407 
                     (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))                      (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
                         continue;                          continue;
   
                 if (len + 1 + (int)strlen(dp->d_name) >= MAXPATHLEN - 1) {                  if (len + 1 + (int)strlen(dp->d_name) >= PATH_MAX - 1) {
                         message(MT_REMOTE|MT_WARNING, "%s/%s: Name too long",                          message(MT_REMOTE|MT_WARNING, "%s/%s: Name too long",
                                 target, dp->d_name);                                  target, dp->d_name);
                         continue;                          continue;
Line 553 
Line 553 
 {  {
         static struct stat stb;          static struct stat stb;
         int s = -1, stbvalid = 0;          int s = -1, stbvalid = 0;
         char name[MAXPATHLEN];          char name[PATH_MAX];
   
         if (DECODE(name, xname) == -1) {          if (DECODE(name, xname) == -1) {
                 error("query: Cannot decode filename");                  error("query: Cannot decode filename");
Line 677 
Line 677 
 static char *  static char *
 savetarget(char *file, opt_t opts)  savetarget(char *file, opt_t opts)
 {  {
         static char savefile[MAXPATHLEN];          static char savefile[PATH_MAX];
   
         if (strlen(file) + sizeof(SAVE_SUFFIX) + 1 > MAXPATHLEN) {          if (strlen(file) + sizeof(SAVE_SUFFIX) + 1 > PATH_MAX) {
                 error("%s: Cannot save: Save name too long", file);                  error("%s: Cannot save: Save name too long", file);
                 return(NULL);                  return(NULL);
         }          }
Line 1110 
Line 1110 
 static void  static void
 recvlink(char *new, opt_t opts, int mode, off_t size)  recvlink(char *new, opt_t opts, int mode, off_t size)
 {  {
         char tbuf[MAXPATHLEN], dbuf[BUFSIZ];          char tbuf[PATH_MAX], dbuf[BUFSIZ];
         struct stat stb;          struct stat stb;
         char *optarget;          char *optarget;
         int uptodate;          int uptodate;
Line 1355 
Line 1355 
         off_t size;          off_t size;
         time_t mtime, atime;          time_t mtime, atime;
         char *owner, *group, *file;          char *owner, *group, *file;
         char new[MAXPATHLEN];          char new[PATH_MAX];
         char fileb[MAXPATHLEN];          char fileb[PATH_MAX];
         int64_t freespace = -1, freefiles = -1;          int64_t freespace = -1, freefiles = -1;
         char *cp = cmd;          char *cp = cmd;
   
Line 1541 
Line 1541 
         opt_t opts;          opt_t opts;
         char *owner, *group, *file;          char *owner, *group, *file;
         char *cp = cmd;          char *cp = cmd;
         char fileb[MAXPATHLEN];          char fileb[PATH_MAX];
   
         /*          /*
          * Get rdist option flags           * Get rdist option flags

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34