[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.19 and 1.20

version 1.19, 2008/05/25 22:33:56 version 1.20, 2009/03/28 15:18:29
Line 1163 
Line 1163 
 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];          char tbuf[MAXPATHLEN], dbuf[BUFSIZ];
         struct stat stb;          struct stat stb;
         char *optarget;          char *optarget;
         int uptodate;          int uptodate;
Line 1180 
Line 1180 
                 return;                  return;
         }          }
   
           if (DECODE(dbuf, buf) == -1) {
                   error("recvlink: cannot decode symlink target");
                   return;
           }
   
         uptodate = 0;          uptodate = 0;
         if ((i = readlink(target, tbuf, sizeof(tbuf)-1)) != -1) {          if ((i = readlink(target, tbuf, sizeof(tbuf)-1)) != -1) {
                 tbuf[i] = '\0';                  tbuf[i] = '\0';
                 if (i == size && strncmp(buf, tbuf, (int) size) == 0)                  if (i == size && strncmp(dbuf, tbuf, (int) size) == 0)
                         uptodate = 1;                          uptodate = 1;
         }          }
         mode &= 0777;          mode &= 0777;
Line 1204 
Line 1209 
         /*          /*
          * Make new symlink using a temporary name           * Make new symlink using a temporary name
          */           */
         if (mktemp(new) == NULL || symlink(buf, new) < 0) {          if (mktemp(new) == NULL || symlink(dbuf, new) < 0) {
                 if (errno != ENOENT || chkparent(new, opts) < 0 ||                  if (errno != ENOENT || chkparent(new, opts) < 0 ||
                     mktemp(new) == NULL || symlink(buf, new) < 0) {                      mktemp(new) == NULL || symlink(dbuf, new) < 0) {
                         error("%s -> %s: symlink failed: %s", new, buf, SYSERR);                          error("%s -> %s: symlink failed: %s", new, dbuf,
                               SYSERR);
                         return;                          return;
                 }                  }
         }          }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20