]> git.sur5r.net Git - bacula/bacula/commitdiff
Stuff object in extended attributes
authorKern Sibbald <kern@sibbald.com>
Wed, 7 Apr 2010 12:04:53 +0000 (14:04 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:50:30 +0000 (16:50 +0200)
bacula/src/filed/backup.c
bacula/src/filed/fd_plugins.c
bacula/src/filed/fd_plugins.h
bacula/src/findlib/find.h
bacula/src/findlib/find_one.c

index 5faeb259dc4ac134e24b75d6dbc31dd38a7bd420..a8303798bfac11859c2462ab78913efa607fb8fa 100644 (file)
@@ -1095,7 +1095,8 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
 {
    BSOCK *sd = jcr->store_bsock;
    char attribs[MAXSTRING];
-   char attribsEx[MAXSTRING];
+   char attribsExBuf[MAXSTRING];
+   char *attribsEx;
    int attr_stream;
    bool stat;
 #ifdef FD_NO_SEND_TEST
@@ -1112,6 +1113,7 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
    encode_stat(attribs, &ff_pkt->statp, ff_pkt->LinkFI, data_stream);
 
    /** Now possibly extend the attributes */
+   attribsEx = attribsExBuf;
    attr_stream = encode_attribsEx(jcr, attribsEx, ff_pkt);
 
    Dmsg3(300, "File %s\nattribs=%s\nattribsEx=%s\n", ff_pkt->fname, attribs, attribsEx);
@@ -1164,6 +1166,9 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
       stat = sd->fsend("%ld %d %s%c%s%c%c%s%c", jcr->JobFiles,
                ff_pkt->type, ff_pkt->link, 0, attribs, 0, 0, attribsEx, 0);
       break;
+   case FT_RESTORE_FIRST:
+      attribsEx = ff_pkt->object;        /* put object as extended attributes */
+      /* Fall through wanted */
    default:
       stat = sd->fsend("%ld %d %s%c%s%c%c%s%c", jcr->JobFiles,
                ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0, attribsEx, 0);
index 6ea3005a6bb32f67c4211ce29e91fc2b4d8420af..beefdef0c6fedd11519a2940b86de64a8a690d4c 100644 (file)
@@ -292,6 +292,10 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
          ff_pkt->fname = fname.c_str();
          ff_pkt->link = link.c_str();
          ff_pkt->type = sp.type;
+         ff_pkt->object = sp.object;
+         if (sp.type == FT_RESTORE_FIRST) {
+            ff_pkt->LinkFI = sp.index;     /* restore object index */
+         }
          memcpy(&ff_pkt->statp, &sp.statp, sizeof(ff_pkt->statp));
          Dmsg1(dbglvl, "Save_file: file=%s\n", fname.c_str());
          save_file(jcr, ff_pkt, true);
index 92235c868bce88413f41c0d71539f019bc7df8b0..6858a5e16de1bd436717eb50664139e10c31a205 100644 (file)
@@ -83,6 +83,7 @@ struct save_pkt {
    bool portable;                     /* set if data format is portable */
    char *cmd;                         /* command */
    char *object;                      /* restore object data to save */
+   int32_t index;                     /* restore object index */
    int32_t pkt_end;                   /* end packet sentinel */
 };
 
index 4033ad316fbe538d42640150a3be132ecedbb872..7d2cbb9b251e68b80ad5263f1a53a28592e8ca2d 100644 (file)
@@ -189,6 +189,7 @@ struct FF_PKT {
    char *top_fname;                   /* full filename before descending */
    char *fname;                       /* full filename */
    char *link;                        /* link if file linked */
+   char *object;                      /* restore object */
    POOLMEM *sys_fname;                /* system filename */
    POOLMEM *fname_save;               /* save when stripping path */
    POOLMEM *link_save;                /* save when stripping path */
index 4d23539eefafcbef7c4426974f6cb713b2df8e9f..ee739576f34fc535d91e9e239365962bcfa6fc2d 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -34,8 +34,6 @@
 
    Thanks to the TAR programmers.
 
-     Version $Id$
-
  */
 
 #include "bacula.h"