]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/find.c
Tweak version date
[bacula/bacula] / bacula / src / findlib / find.c
index d2da062c86e7e8be2a108d622f837343766879c1..cf707265f6f9657d2b6abf7047345c613edf6860 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -40,7 +40,7 @@
 #include "bacula.h"
 #include "find.h"
 
-static const int dbglvl = 150;
+static const int dbglvl = 450;
 
 int32_t name_max;              /* filename max length */
 int32_t path_max;              /* path name max length */
@@ -121,10 +121,14 @@ get_win32_driveletters(FF_PKT *ff, char* szDrives)
 #if !defined(HAVE_WIN32)
    return 0;
 #endif
+   int nCount;
+   /* Can be already filled by plugin, so check that everything
+    * is on upper case. TODO: can check for dupplicate?
+    */
+   for (nCount = 0; nCount < 27 && szDrives[nCount] ; nCount++) {
+      szDrives[nCount] = toupper(szDrives[nCount]);
+   }
 
-   szDrives[0] = 0; /* make empty */
-   int nCount = 0;
-    
    findFILESET *fileset = ff->fileset;
    if (fileset) {
       int i;
@@ -176,8 +180,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:mcs"); /* mtime+ctime+size by default */
-      strcpy(ff->BaseJobOpts, "J:mspug5"); /* mtime+size+perm+user+group+chk  */
+      strcpy(ff->AccurateOpts, "Cmcs");  /* mtime+ctime+size by default */
+      strcpy(ff->BaseJobOpts, "Jspug5"); /* 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;
@@ -188,14 +192,22 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT *ff_pkt, bool to
          for (j=0; j<incexe->opts_list.size(); j++) {
             findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
             ff->flags |= fo->flags;
-            ff->GZIP_level = fo->GZIP_level;
+            ff->Compress_algo = fo->Compress_algo;
+            ff->Compress_level = fo->Compress_level;
             ff->strip_path = fo->strip_path;
             ff->fstypes = fo->fstype;
             ff->drivetypes = fo->drivetype;
+            ff->plugin = fo->plugin; /* TODO: generate a plugin event ? */
+            ff->opt_plugin = (ff->plugin != NULL)? true : false;
             bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
-            bstrncat(ff->AccurateOpts, fo->AccurateOpts, sizeof(ff->AccurateOpts));
-            bstrncat(ff->BaseJobOpts, fo->BaseJobOpts, sizeof(ff->BaseJobOpts));
+            if (fo->AccurateOpts[0]) {
+               bstrncpy(ff->AccurateOpts, fo->AccurateOpts, sizeof(ff->AccurateOpts));
+            }
+            if (fo->BaseJobOpts[0]) {
+               bstrncpy(ff->BaseJobOpts, fo->BaseJobOpts, sizeof(ff->BaseJobOpts));
+            }
          }
+         Dmsg3(50, "Verify=<%s> Accurate=<%s> BaseJob=<%s>\n", ff->VerifyOpts, ff->AccurateOpts, ff->BaseJobOpts);
          dlistString *node;
          foreach_dlist(node, &incexe->name_list) {
             char *fname = node->c_str();
@@ -291,7 +303,8 @@ static bool accept_file(FF_PKT *ff)
    for (j = 0; j < incexe->opts_list.size(); j++) {
       findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
       ff->flags = fo->flags;
-      ff->GZIP_level = fo->GZIP_level;
+      ff->Compress_algo = fo->Compress_algo;
+      ff->Compress_level = fo->Compress_level;
       ff->fstypes = fo->fstype;
       ff->drivetypes = fo->drivetype;
 
@@ -436,7 +449,6 @@ static int our_callback(JCR *jcr, FF_PKT *ff, bool top_level)
    case FT_INVALIDFS:
    case FT_INVALIDDT:
    case FT_NOOPEN:
-   case FT_REPARSE:
 //    return ff->file_save(jcr, ff, top_level);
 
    /* These items can be filtered */
@@ -450,6 +462,8 @@ static int our_callback(JCR *jcr, FF_PKT *ff, bool top_level)
    case FT_FIFO:
    case FT_SPEC:
    case FT_DIRNOCHG:
+   case FT_REPARSE:
+   case FT_JUNCTION:
       if (accept_file(ff)) {
          return ff->file_save(jcr, ff, top_level);
       } else {