]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/filed/verify.c
authorAlain Spineux <alain@baculasystems.com>
Mon, 20 Apr 2020 13:52:09 +0000 (15:52 +0200)
committerEric Bollengier <eric@baculasystems.com>
Mon, 22 Jun 2020 08:49:25 +0000 (10:49 +0200)
This commit is the result of the squash of the following main commits:

Author: Alain Spineux <alain@baculasystems.com>
Date:   Tue Aug 28 17:14:31 2018 +0200

    snapshot: maintain both paths instead of stripping and unstripping

    - snap_fname is the path inside the snapshot used for "system" operation
    - fname is the path from the FileSet used for display and for SD or DIR
      "computation"
    - when snapshot is not in used, both are equal

bacula/src/filed/verify.c

index ec491d8267a7786f3152f2d19bc9b0f4add86003..2cebcf45784a9c2bc52f211ac2701d1114cfff0b 100644 (file)
@@ -295,7 +295,7 @@ int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest)
    if (ff_pkt->statp.st_size > 0 || ff_pkt->type == FT_RAW
          || ff_pkt->type == FT_FIFO) {
       int noatime = ff_pkt->flags & FO_NOATIME ? O_NOATIME : 0;
-      if ((bopen(&bfd, ff_pkt->fname, O_RDONLY | O_BINARY | noatime, 0)) < 0) {
+      if ((bopen(&bfd, ff_pkt->snap_fname, O_RDONLY | O_BINARY | noatime, 0)) < 0) {
          ff_pkt->ff_errno = errno;
          berrno be;
          be.set_errno(bfd.berrno);
@@ -311,7 +311,7 @@ int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest)
 #ifdef HAVE_DARWIN_OS
    /* Open resource fork if necessary */
    if (ff_pkt->flags & FO_HFSPLUS && ff_pkt->hfsinfo.rsrclength > 0) {
-      if (bopen_rsrc(&bfd, ff_pkt->fname, O_RDONLY | O_BINARY, 0) < 0) {
+      if (bopen_rsrc(&bfd, ff_pkt->snap_fname, O_RDONLY | O_BINARY, 0) < 0) {
          ff_pkt->ff_errno = errno;
          berrno be;
          Jmsg(jcr, M_ERROR, -1, _("     Cannot open resource fork for %s: ERR=%s.\n"),