]> git.sur5r.net Git - bacula/bacula/commitdiff
Add stat packet size to encode/decode_ routines to detect compile differences
authorKern Sibbald <kern@sibbald.com>
Wed, 4 May 2011 09:39:57 +0000 (11:39 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:44:36 +0000 (14:44 +0200)
15 files changed:
bacula/src/dird/ua_dotcmds.c
bacula/src/dird/ua_tree.c
bacula/src/dird/verify.c
bacula/src/filed/accurate.c
bacula/src/filed/backup.c
bacula/src/filed/restore.c
bacula/src/filed/verify.c
bacula/src/filed/xattr.c
bacula/src/findlib/attribs.c
bacula/src/findlib/protos.h
bacula/src/qt-console/restore/brestore.cpp
bacula/src/stored/bextract.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/tools/bvfs_test.c

index a2f9c288b6710635a6c0685220edbce8c97378e5..9959298bbc64f61409a9e4ab8099da879d40fece 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2011 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.
@@ -211,7 +211,7 @@ static int bvfs_result_handler(void *ctx, int fields, char **row)
    }
 
    memset(&statp, 0, sizeof(struct stat));
-   decode_stat(lstat, &statp, &LinkFI);
+   decode_stat(lstat, &statp, sizeof(statp), &LinkFI);
 
    Dmsg1(100, "type=%s\n", row[0]);
    if (bvfs_is_dir(row)) {
index 71117a94ef70f6b0bc1af0e6b5031229a5efb969..84c0898585efa0335919bece58440f5625e374a2 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2011 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.
@@ -205,7 +205,7 @@ int insert_tree_handler(void *ctx, int num_fields, char **row)
    } else {
       type = TN_FILE;
    }
-   hard_link = (decode_LinkFI(row[4], &statp) != 0);
+   hard_link = (decode_LinkFI(row[4], &statp, sizeof(statp)) != 0);
    node = insert_tree_node(row[0], row[1], type, tree->root, NULL);
    JobId = str_to_int64(row[3]);
    FileIndex = str_to_int64(row[2]);
@@ -322,7 +322,7 @@ static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extr
       fdbr.JobId = node->JobId;
       if (node->hard_link && db_get_file_attributes_record(ua->jcr, ua->db, cwd, NULL, &fdbr)) {
          int32_t LinkFI;
-         decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
+         decode_stat(fdbr.LStat, &statp, sizeof(statp), &LinkFI); /* decode stat pkt */
          /*
           * If we point to a hard linked file, traverse the tree to
           * find that file, and mark it to be restored as well. It
@@ -705,7 +705,7 @@ static int do_dircmd(UAContext *ua, TREE_CTX *tree, bool dot_cmd)
          }
          if (db_get_file_attributes_record(ua->jcr, ua->db, pcwd, NULL, &fdbr)) {
             int32_t LinkFI;
-            decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
+            decode_stat(fdbr.LStat, &statp, sizeof(statp), &LinkFI); /* decode stat pkt */
          } else {
             /* Something went wrong getting attributes -- print name */
             memset(&statp, 0, sizeof(statp));
@@ -750,7 +750,7 @@ static int estimatecmd(UAContext *ua, TREE_CTX *tree)
             fdbr.JobId = node->JobId;
             if (db_get_file_attributes_record(ua->jcr, ua->db, cwd, NULL, &fdbr)) {
                int32_t LinkFI;
-               decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
+               decode_stat(fdbr.LStat, &statp, sizeof(statp), &LinkFI); /* decode stat pkt */
                if (S_ISREG(statp.st_mode) && statp.st_size > 0) {
                   total_bytes += statp.st_size;
                }
index 41cb9019cfc3dc3c32ba6e3feff8d9d06a7a46c3..e325c23d59beff23f61f6498a5f470d895814110 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -598,7 +598,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
          jcr->JobFiles++;
          jcr->FileIndex = file_index;    /* remember attribute file_index */
          jcr->previous_jr.FileIndex = file_index;
-         decode_stat(attr, &statf, &LinkFIf);  /* decode file stat packet */
+         decode_stat(attr, &statf, sizeof(statf), &LinkFIf);  /* decode file stat packet */
          do_Digest = CRYPTO_DIGEST_NONE;
          jcr->fn_printed = false;
          pm_strcpy(jcr->fname, fname);  /* move filename into JCR */
@@ -626,7 +626,7 @@ void get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
 
          Dmsg3(400, "Found %s in catalog. inx=%d Opts=%s\n", jcr->fname,
             file_index, Opts_Digest);
-         decode_stat(fdbr.LStat, &statc, &LinkFIc); /* decode catalog stat */
+         decode_stat(fdbr.LStat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */
          /*
           * Loop over options supplied by user and verify the
           * fields he requests.
index 77866a82d380d7e7f7eb7f33e0c1ad107c57c8a2..2c01bab5ff4eaa0d74a886cc9f631b5c70d55062 100644 (file)
@@ -116,7 +116,7 @@ static bool accurate_send_base_file_list(JCR *jcr)
       if (elt->seen) {
          Dmsg2(dbglvl, "base file fname=%s seen=%i\n", elt->fname, elt->seen);
          /* TODO: skip the decode and use directly the lstat field */
-         decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */  
+         decode_stat(elt->lstat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */  
          ff_pkt->fname = elt->fname;
          ff_pkt->statp = statc;
          encode_and_send_attributes(jcr, ff_pkt, stream);
@@ -158,7 +158,7 @@ static bool accurate_send_deleted_list(JCR *jcr)
       }
       Dmsg2(dbglvl, "deleted fname=%s seen=%i\n", elt->fname, elt->seen);
       /* TODO: skip the decode and use directly the lstat field */
-      decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */
+      decode_stat(elt->lstat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */
       ff_pkt->fname = elt->fname;
       ff_pkt->statp.st_mtime = statc.st_mtime;
       ff_pkt->statp.st_ctime = statc.st_ctime;
@@ -283,7 +283,7 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
       goto bail_out;
    }
 
-   decode_stat(elt.lstat, &statc, &LinkFIc); /* decode catalog stat */
+   decode_stat(elt.lstat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */
 
    if (!jcr->rerunning && (jcr->getJobLevel() == L_FULL)) {
       opts = ff_pkt->BaseJobOpts;
index 21b1906de13eec7f738ec6d136e4526aba29d26d..6ac8721c6d7f390dd0d99a692b7230e2b0571f7e 100644 (file)
@@ -1149,7 +1149,7 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
       Jmsg0(jcr, M_FATAL, 0, _("Invalid file flags, no supported data stream type.\n"));
       return false;
    }
-   encode_stat(attribs, &ff_pkt->statp, ff_pkt->LinkFI, data_stream);
+   encode_stat(attribs, &ff_pkt->statp, sizeof(ff_pkt->statp), ff_pkt->LinkFI, data_stream);
 
    /** Now possibly extend the attributes */
    if (ff_pkt->type == FT_RESTORE_FIRST) {
index 542ce8490db416d2fbc9335fe7d67bf23a6c3363..ed4d7243ff37d1300259a61220ab505346d1200a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -341,7 +341,7 @@ void do_restore(JCR *jcr)
          Dmsg3(100, "=== msglen=%d attrExlen=%d msg=%s\n", sd->msglen,
                strlen(attr->attrEx), sd->msg);
 
-         attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+         attr->data_stream = decode_stat(attr->attr, &attr->statp, sizeof(attr->statp), &attr->LinkFI);
 
          if (!is_restore_stream_supported(attr->data_stream)) {
             if (!non_support_data++) {
index 237e7718dba23a133d28b18771646af398db79f5..8992d7dd0b69ab28607bcdd92cc15f11789e208d 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -172,7 +172,7 @@ static int verify_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
    }
 
    /* Encode attributes and possibly extend them */
-   encode_stat(attribs, &ff_pkt->statp, ff_pkt->LinkFI, 0);
+   encode_stat(attribs, &ff_pkt->statp, sizeof(ff_pkt->statp), ff_pkt->LinkFI, 0);
    encode_attribsEx(jcr, attribsEx, ff_pkt);
 
    jcr->lock();
index eb4ea5d98c033159031b4e70c8df81899a682115..0be8385ec0d04c66cbe1dc6623753200ba32f14a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2008-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2008-2011 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.
@@ -2396,7 +2396,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
        * The current implementation of xattr on Solaris doesn't support this, but if it ever does we are prepared.
        * Encode the stat struct into an ASCII representation.
        */
-      encode_stat(attribs, &st, 0, stream);
+      encode_stat(attribs, &st, sizeof(st), 0, stream);
       cnt = bsnprintf(buffer, sizeof(buffer), "%s%c%s%c%s%c",
                      target_attrname, 0, attribs, 0, (acl_text) ? acl_text : "", 0);
       break;
@@ -2417,7 +2417,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
           * first real xattr. Encode the stat struct into an ASCII representation and jump
           * out of the function.
           */
-         encode_stat(attribs, &st, 0, stream);
+         encode_stat(attribs, &st, sizeof(st), 0, stream);
          cnt = bsnprintf(buffer, sizeof(buffer),
                          "%s%c%s%c%s%c",
                          target_attrname, 0, attribs, 0, (acl_text) ? acl_text : "", 0);
@@ -2429,7 +2429,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
           * The current implementation of xattr on Solaris doesn't support this, but if it ever does we are prepared.
           * Encode the stat struct into an ASCII representation.
           */
-         encode_stat(attribs, &st, 0, stream);
+         encode_stat(attribs, &st, sizeof(st), 0, stream);
          cnt = bsnprintf(buffer, sizeof(buffer),
                          "%s%c%s%c%s%c",
                          target_attrname, 0, attribs, 0, (acl_text) ? acl_text : "", 0);
@@ -2447,7 +2447,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
             /*
              * Generate a xattr encoding with the reference to the target in there.
              */
-            encode_stat(attribs, &st, st.st_ino, stream);
+            encode_stat(attribs, &st, sizeof(st), st.st_ino, stream);
             cnt = bsnprintf(buffer, sizeof(buffer),
                             "%s%c%s%c%s%c",
                             target_attrname, 0, attribs, 0, xlce->target, 0);
@@ -2478,7 +2478,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
       /*
        * Encode the stat struct into an ASCII representation.
        */
-      encode_stat(attribs, &st, 0, stream);
+      encode_stat(attribs, &st, sizeof(st), 0, stream);
       cnt = bsnprintf(buffer, sizeof(buffer),
                      "%s%c%s%c%s%c",
                      target_attrname, 0, attribs, 0, (acl_text) ? acl_text : "", 0);
@@ -2522,7 +2522,7 @@ static bxattr_exit_code solaris_save_xattr(JCR *jcr, int fd, const char *xattr_n
       /*
        * Generate a xattr encoding with the reference to the target in there.
        */
-      encode_stat(attribs, &st, st.st_ino, stream);
+      encode_stat(attribs, &st, sizeof(st), st.st_ino, stream);
       cnt = bsnprintf(buffer, sizeof(buffer),
                       "%s%c%s%c%s%c",
                       target_attrname, 0, attribs, 0, link_source, 0);
@@ -2975,7 +2975,7 @@ static bxattr_exit_code solaris_restore_xattrs(JCR *jcr, bool is_extensible)
    /*
     * Decode the attributes from the stream.
     */
-   decode_stat(attribs, &st, &inum);
+   decode_stat(attribs, &st, sizeof(st), &inum);
 
    /*
     * Decode the next field (acl_text).
index c1043308e82abf6be4097c13c067addd87010a67..419689fd8ef027220e1952d1e76f5734ec852be5 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2011 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.
@@ -170,10 +170,17 @@ int select_data_stream(FF_PKT *ff_pkt)
  *   them in the encode_attribsEx() subroutine, but this is
  *   not recommended.
  */
-void encode_stat(char *buf, struct stat *statp, int32_t LinkFI, int data_stream)
+void encode_stat(char *buf, struct stat *statp, int stat_size, int32_t LinkFI, int data_stream)
 {
    char *p = buf;
 
+   /*
+    * We read the stat packet so make sure the caller's conception
+    *  is the same as ours.  They can be different if LARGEFILE is not
+    *  the same when compiling this library and the calling program.
+    */
+   ASSERT(stat_size == (int)sizeof(struct stat));
+      
    /**
     *  Encode a stat packet.  I should have done this more intelligently
     *   with a length so that it could be easily expanded.
@@ -245,11 +252,18 @@ void encode_stat(char *buf, struct stat *statp, int32_t LinkFI, int data_stream)
 
 
 /** Decode a stat packet from base64 characters */
-int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI)
+int decode_stat(char *buf, struct stat *statp, int stat_size, int32_t *LinkFI)
 {
    char *p = buf;
    int64_t val;
 
+   /*
+    * We store into the stat packet so make sure the caller's conception
+    *  is the same as ours.  They can be different if LARGEFILE is not
+    *  the same when compiling this library and the calling program.
+    */
+   ASSERT(stat_size == (int)sizeof(struct stat));
+
    p += from_base64(&val, p);
    plug(statp->st_dev, val);
    p++;
@@ -330,10 +344,16 @@ int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI)
 }
 
 /** Decode a LinkFI field of encoded stat packet */
-int32_t decode_LinkFI(char *buf, struct stat *statp)
+int32_t decode_LinkFI(char *buf, struct stat *statp, int stat_size)
 {
    char *p = buf;
    int64_t val;
+   /*
+    * We store into the stat packet so make sure the caller's conception
+    *  is the same as ours.  They can be different if LARGEFILE is not
+    *  the same when compiling this library and the calling program.
+    */
+   ASSERT(stat_size == (int)sizeof(struct stat));
 
    skip_nonspaces(&p);                /* st_dev */
    p++;                               /* skip space */
index b738b21d6d3496dec911b0e90b038e6b6da6a3da..fc6fccbdbf8b67ee3972b4f296395be5c80ddaff 100644 (file)
@@ -32,9 +32,9 @@
  */
 
 /* from attribs.c */
-void    encode_stat       (char *buf, struct stat *statp, int32_t LinkFI, int data_stream);
-int     decode_stat       (char *buf, struct stat *statp, int32_t *LinkFI);
-int32_t decode_LinkFI     (char *buf, struct stat *statp);
+void    encode_stat       (char *buf, struct stat *statp, int stat_size, int32_t LinkFI, int data_stream);
+int     decode_stat       (char *buf, struct stat *statp, int stat_size, int32_t *LinkFI);
+int32_t decode_LinkFI     (char *buf, struct stat *statp, int stat_size);
 int     encode_attribsEx  (JCR *jcr, char *attribsEx, FF_PKT *ff_pkt);
 bool    set_attributes    (JCR *jcr, ATTR *attr, BFILE *ofd);
 int     select_data_stream(FF_PKT *ff_pkt);
index 8102409327fa81b8ea2ced4bc3505ecdfc6e7dec..f1b6b2905d8231a8658a3fdf9fb7bebd7246334c 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2011 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.
@@ -139,7 +139,7 @@ void bRestore::setJob()
    Pmsg0(000, "update done\n");
 }
 
-extern int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI);
+extern int decode_stat(char *buf, struct stat *statp, int stat_size, int32_t *LinkFI);
 
 // refresh button with a filter or limit/offset change
 void bRestore::refreshView()
@@ -209,7 +209,7 @@ void bRestore::displayFiles(int64_t pathid, QString path)
           * Note, the next line zaps variable "item", probably
           *   because the input data in fieldlist is bad.
           */
-         decode_stat(fieldlist.at(4).toLocal8Bit().data(), &statp, &LinkFI);
+         decode_stat(fieldlist.at(4).toLocal8Bit().data(), &statp, sizeof(statp),  &LinkFI);
          TableItemFormatter item(*FileList, row++);
          item.setFileType(col++, QString("folder")); // folder or file
          item.setTextFld(col++, fieldlist.at(5)); // path
@@ -233,7 +233,7 @@ void bRestore::displayFiles(int64_t pathid, QString path)
          TableItemFormatter item(*FileList, row++);
          item.setTextFld(col++, fieldlist.at(5)); // name
          decode_stat(fieldlist.at(4).toLocal8Bit().data(), 
-                     &statp, &LinkFI);
+                     &statp, sizeof(statp), &LinkFI);
          item.setBytesFld(col++, QString().setNum(statp.st_size));
          item.setDateFld(col++, statp.st_mtime);
          // keep original info on the first cel that is never empty
@@ -290,7 +290,7 @@ void bRestore::displayFileVersion(QString pathid, QString fnid,
          item.setTextFld(col++, fieldlist.at(6)); // Volume
          item.setNumericFld(col++, fieldlist.at(3)); // JobId
          decode_stat(fieldlist.at(4).toLocal8Bit().data(), 
-                     &statp, &LinkFI);
+                     &statp, sizeof(statp), &LinkFI);
          item.setBytesFld(col++, QString().setNum(statp.st_size)); // size
          item.setDateFld(col++, statp.st_mtime); // date
          item.setTextFld(col++, fieldlist.at(5)); // chksum
@@ -463,7 +463,7 @@ void bRestoreTable::dropEvent(QDropEvent *event)
       }
       item.setTextFld(col++, fields.at(5)); // filename
       decode_stat(fields.at(4).toLocal8Bit().data(), 
-                  &statp, &LinkFI);
+                  &statp, sizeof(statp), &LinkFI);
       item.setBytesFld(col++, QString().setNum(statp.st_size)); // size
       item.setDateFld(col++, statp.st_mtime); // date
       item.setNumericFld(col++, fields.at(3)); // jobid
@@ -561,7 +561,7 @@ void bRestore::get_info_from_selection(QStringList &fileids,
          fileids << lst.at(2);
          jobids << lst.at(3);
          decode_stat(lst.at(4).toLocal8Bit().data(), 
-                     &statp, &LinkFI);
+                     &statp, sizeof(statp), &LinkFI);
          if (LinkFI) {
             findexes << lst.at(3) + "," + QString().setNum(LinkFI);
          }
index 286c474c44c3840d3d9ccd8f8ff04178207eb7bf..2e2a44919d59924ef1c6d3546e0dec3a02541215 100644 (file)
@@ -328,7 +328,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       }
 
       if (file_is_included(ff, attr->fname) && !file_is_excluded(ff, attr->fname)) {
-         attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+         attr->data_stream = decode_stat(attr->attr, &attr->statp, sizeof(attr->statp), &attr->LinkFI);
          if (!is_restore_stream_supported(attr->data_stream)) {
             if (!non_support_data++) {
                Jmsg(jcr, M_ERROR, 0, _("%s stream not supported on this Client.\n"),
index e9758c0e46eb355d4fc2d677e7050b8f36bb9a4c..a7c396e5741a0b68733f3ea7210f27d8b991f255 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -391,7 +391,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
          return true;
       }
 
-      attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+      attr->data_stream = decode_stat(attr->attr, &attr->statp, sizeof(attr->statp), &attr->LinkFI);
       build_attr_output_fnames(jcr, attr);
 
       if (file_is_included(ff, attr->fname) && !file_is_excluded(ff, attr->fname)) {
index dd373b9084ce4d35ac710d4b43098893672490bf..060579601920287eb17a5232bf2f8c8020da36a9 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2011 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.
@@ -689,7 +689,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       }
 
       if (verbose > 1) {
-         decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+         decode_stat(attr->attr, &attr->statp, sizeof(attr->statp), &attr->LinkFI);
          build_attr_output_fnames(bjcr, attr);
          print_ls_output(bjcr, attr);
       }
index 545591c09e4b66f6fd1bad22c152f255f55c96c6..06ecbecab20d4855ecd837192065c0d31f52682f 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2009-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2009-2011 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.
@@ -79,10 +79,9 @@ static int result_handler(void *ctx, int fields, char **row)
 
    memset(&attr->statp, 0, sizeof(struct stat));
    decode_stat((row[BVFS_LStat] && row[BVFS_LStat][0])?row[BVFS_LStat]:empty,
-               &attr->statp, &attr->LinkFI);
+               &attr->statp, sizeof(attr->statp),  &attr->LinkFI);
 
-   if (bvfs_is_dir(row) || bvfs_is_file(row))
-   {
+   if (bvfs_is_dir(row) || bvfs_is_file(row)) {
       /* display clean stuffs */
 
       if (bvfs_is_dir(row)) {