]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/find.c
Make a missing plugin during backup fatal
[bacula/bacula] / bacula / src / findlib / find.c
index efa6820d6d8415ca5d622b6b1f0590e0e2b3f20d..e6ad61669289d03013a928c42148c9f4fbcd01bd 100644 (file)
@@ -67,13 +67,13 @@ FF_PKT *init_find_files()
 
    /* Get system path and filename maximum lengths */
    path_max = pathconf(".", _PC_PATH_MAX);
-   if (path_max < 1024) {
-      path_max = 1024;
+   if (path_max < 2048) {
+      path_max = 2048;
    }
 
    name_max = pathconf(".", _PC_NAME_MAX);
-   if (name_max < 1024) {
-      name_max = 1024;
+   if (name_max < 2048) {
+      name_max = 2048;
    }
    path_max++;                        /* add for EOS */
    name_max++;                        /* add for EOS */
@@ -175,7 +175,8 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT *ff_pkt, bool to
       ff->flags = 0;
       ff->VerifyOpts[0] = 'V';
       ff->VerifyOpts[1] = 0;
-      strcpy(ff->AccurateOpts, "C:mc"); /* mtime+ctime by default */
+      strcpy(ff->AccurateOpts, "C:mcs"); /* mtime+ctime+size by default */
+      strcpy(ff->BaseJobOpts, "J:mspug5"); /* mtime+size+perm+user+group+chk  */
       for (i=0; i<fileset->include_list.size(); i++) {
          findINCEXE *incexe = (findINCEXE *)fileset->include_list.get(i);
          fileset->incexe = incexe;
@@ -192,6 +193,7 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT *ff_pkt, bool to
             ff->drivetypes = fo->drivetype;
             bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
             bstrncat(ff->AccurateOpts, fo->AccurateOpts, sizeof(ff->AccurateOpts));
+            bstrncat(ff->BaseJobOpts, fo->BaseJobOpts, sizeof(ff->BaseJobOpts));
          }
          dlistString *node;
          foreach_dlist(node, &incexe->name_list) {
@@ -202,15 +204,17 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT *ff_pkt, bool to
                return 0;                  /* error return */
             }
          }
-         if (plugin_save) {
-            foreach_dlist(node, &incexe->plugin_list) {
-               char *fname = node->c_str();
-               Dmsg1(100, "PluginCommand: %s\n", fname);
-               ff->top_fname = fname;
-               ff->cmd_plugin = true;
-               plugin_save(jcr, ff, true);
-               ff->cmd_plugin = false;
+         foreach_dlist(node, &incexe->plugin_list) {
+            char *fname = node->c_str();
+            if (!plugin_save) {
+               Jmsg(jcr, M_FATAL, 0, _("Plugin: \"%s\" not found.\n"), fname);
+               return 0;
             }
+            Dmsg1(100, "PluginCommand: %s\n", fname);
+            ff->top_fname = fname;
+            ff->cmd_plugin = true;
+            plugin_save(jcr, ff, true);
+            ff->cmd_plugin = false;
          }
       }
    }
@@ -240,18 +244,16 @@ bool is_in_fileset(FF_PKT *ff)
             }
          }
       }
-#ifdef xxx
       for (i=0; i<fileset->exclude_list.size(); i++) {
          incexe = (findINCEXE *)fileset->exclude_list.get(i);
          foreach_dlist(node, &incexe->name_list) {
             fname = node->c_str();
-            Dmsg2(000, "Exc fname=%s ff->fname=%s\n", fname, ff->fname);
+            Dmsg2(100, "Exc fname=%s ff->fname=%s\n", fname, ff->fname);
             if (strcmp(fname, ff->fname) == 0) {
                return true;
             }
          }
       }
-#endif
    }
    return false;
 }
@@ -282,7 +284,6 @@ static bool accept_file(FF_PKT *ff)
       findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
       ff->flags = fo->flags;
       ff->GZIP_level = fo->GZIP_level;
-      ff->ignoredir = fo->ignoredir;
       ff->fstypes = fo->fstype;
       ff->drivetypes = fo->drivetype;