]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/catreq.c
Keep the same keywords as in previous version
[bacula/bacula] / bacula / src / dird / catreq.c
index 910cc57d5ef81034cc64435d054b2863ae8c94f4..ab858a90fc68a9eb9ddf3bc48203fdd9b30b7ce5 100644 (file)
@@ -418,6 +418,7 @@ static void update_attribute(JCR *jcr, char *msg, int32_t msglen)
     *   Encoded attributes
     *   Link name (if type==FT_LNK or FT_LNKSAVED)
     *   Encoded extended-attributes (for Win32)
+    *   Delta sequence number (32 bit int)
     *
     * Restore Object
     *   File_index
@@ -447,14 +448,26 @@ static void update_attribute(JCR *jcr, char *msg, int32_t msglen)
       jcr->attr = check_pool_memory_size(jcr->attr, msglen);
       memcpy(jcr->attr, msg, msglen);
       p = jcr->attr - msg + p;    /* point p into jcr->attr */
-      skip_nonspaces(&p);             /* skip FileIndex */
+      skip_nonspaces(&p);         /* skip FileIndex */
       skip_spaces(&p);
       ar->FileType = str_to_int32(p); 
-      skip_nonspaces(&p);             /* skip FileType */
+      skip_nonspaces(&p);         /* skip FileType */
       skip_spaces(&p);
       fname = p;
       len = strlen(fname);        /* length before attributes */
       attr = &fname[len+1];
+      ar->DeltaSeq = 0;
+      if (ar->FileType == FT_REG) {
+         p = attr + strlen(attr) + 1;  /* point to link */
+         p = p + strlen(p) + 1;        /* point to extended attributes */
+         p = p + strlen(p) + 1;        /* point to delta sequence */
+         /*
+          * Older FDs don't have a delta sequence, so check if it is there 
+          */
+         if (p - jcr->attr < msglen) {
+            ar->DeltaSeq = str_to_int32(p); /* delta_seq */
+         }
+      }
 
       Dmsg2(400, "dird<stored: stream=%d %s\n", Stream, fname);
       Dmsg1(400, "dird<stored: attr=%s\n", attr);