]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/backup.c
Fix bug #1246 Sometimes access denied with VSS enabled. UCS
[bacula/bacula] / bacula / src / filed / backup.c
index 9a5db19fbfcd266dd6503e720a6a88e3851e2c05..e0c9ba9f46a37d3e9bf894487514b201ae07f6d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2009 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.
@@ -46,22 +46,6 @@ static bool crypto_session_start(JCR *jcr);
 static void crypto_session_end(JCR *jcr);
 static bool crypto_session_send(JCR *jcr, BSOCK *sd);
 
-/*
- * check for BSD nodump flag
- */
-static bool no_dump(JCR *jcr, FF_PKT *ff_pkt)
-{
-#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP)
-   if ( (ff_pkt->flags & FO_HONOR_NODUMP) &&
-        (ff_pkt->statp.st_flags & UF_NODUMP) ) {
-      Jmsg(jcr, M_INFO, 1, _("     NODUMP flag set - will not process %s\n"),
-           ff_pkt->fname);
-      return true;                    /* do not backup this file */
-   }
-#endif
-   return false;                      /* do backup */
-}
-
 /*
  * Find all the requested files and send them
  * to the Storage daemon.
@@ -305,14 +289,10 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       break;
    case FT_REGE:
       Dmsg1(130, "FT_REGE saving: %s\n", ff_pkt->fname);
-      if (no_dump(jcr, ff_pkt))
-          return 1;
       has_file_data = true;
       break;
    case FT_REG:
       Dmsg1(130, "FT_REG saving: %s\n", ff_pkt->fname);
-      if (no_dump(jcr, ff_pkt))
-          return 1;
       has_file_data = true;
       break;
    case FT_LNK:
@@ -320,8 +300,6 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       break;
    case FT_DIRBEGIN:
       jcr->num_files_examined--;      /* correct file count */
-      if (no_dump(jcr, ff_pkt))       /* disable recursion on nodump directories */
-          ff_pkt->flags |= FO_NO_RECURSION;
       return 1;                       /* not used */
    case FT_NORECURSE:
       Jmsg(jcr, M_INFO, 1, _("     Recursion turned off. Will not descend from %s into %s\n"),
@@ -367,21 +345,21 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       berrno be;
       Jmsg(jcr, M_NOTSAVED, 0, _("     Could not access \"%s\": ERR=%s\n"), ff_pkt->fname,
          be.bstrerror(ff_pkt->ff_errno));
-      jcr->Errors++;
+      jcr->JobErrors++;
       return 1;
    }
    case FT_NOFOLLOW: {
       berrno be;
       Jmsg(jcr, M_NOTSAVED, 0, _("     Could not follow link \"%s\": ERR=%s\n"), 
            ff_pkt->fname, be.bstrerror(ff_pkt->ff_errno));
-      jcr->Errors++;
+      jcr->JobErrors++;
       return 1;
    }
    case FT_NOSTAT: {
       berrno be;
       Jmsg(jcr, M_NOTSAVED, 0, _("     Could not stat \"%s\": ERR=%s\n"), ff_pkt->fname,
          be.bstrerror(ff_pkt->ff_errno));
-      jcr->Errors++;
+      jcr->JobErrors++;
       return 1;
    }
    case FT_DIRNOCHG:
@@ -395,13 +373,13 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       berrno be;
       Jmsg(jcr, M_NOTSAVED, 0, _("     Could not open directory \"%s\": ERR=%s\n"), 
            ff_pkt->fname, be.bstrerror(ff_pkt->ff_errno));
-      jcr->Errors++;
+      jcr->JobErrors++;
       return 1;
    }
    default:
       Jmsg(jcr, M_NOTSAVED, 0,  _("     Unknown file type %d; not saved: %s\n"), 
            ff_pkt->type, ff_pkt->fname);
-      jcr->Errors++;
+      jcr->JobErrors++;
       return 1;
    }
 
@@ -455,7 +433,7 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
          if (signing_digest == NULL) {
             Jmsg(jcr, M_NOTSAVED, 0, _("%s signature digest initialization failed\n"),
                stream_to_ascii(signing_algorithm));
-            jcr->Errors++;
+            jcr->JobErrors++;
             goto good_rtn;
          }
       }
@@ -527,7 +505,7 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
          berrno be;
          Jmsg(jcr, M_NOTSAVED, 0, _("     Cannot open \"%s\": ERR=%s.\n"), ff_pkt->fname,
               be.bstrerror());
-         jcr->Errors++;
+         jcr->JobErrors++;
          if (tid) {
             stop_thread_timer(tid);
             tid = NULL;
@@ -564,7 +542,7 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
             berrno be;
             Jmsg(jcr, M_NOTSAVED, -1, _("     Cannot open resource fork for \"%s\": ERR=%s.\n"), 
                  ff_pkt->fname, be.bstrerror());
-            jcr->Errors++;
+            jcr->JobErrors++;
             if (is_bopen(&ff_pkt->bfd)) {
                bclose(&ff_pkt->bfd);
             }
@@ -977,7 +955,7 @@ static int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest,
       berrno be;
       Jmsg(jcr, M_ERROR, 0, _("Read error on file %s. ERR=%s\n"),
          ff_pkt->fname, be.bstrerror(ff_pkt->bfd.berrno));
-      if (jcr->Errors++ > 1000) {       /* insanity check */
+      if (jcr->JobErrors++ > 1000) {       /* insanity check */
          Jmsg(jcr, M_FATAL, 0, _("Too many errors.\n"));
       }
    } else if (ff_pkt->flags & FO_ENCRYPT) {