]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/match.c
Ensure that StorageId is updated after write
[bacula/bacula] / bacula / src / findlib / match.c
index c285ce7fce1b0b1d7b99c4df5c695df55194a1a7..beffad50bc01ec3259fd9150c4120ae12a0844ae 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.
@@ -42,9 +42,8 @@
 
 #include "bacula.h"
 #include "find.h"
+#include "ch.h"
 
-#include <pwd.h>
-#include <grp.h>
 #include <sys/types.h>
 
 #ifndef FNM_LEADING_DIR
@@ -187,14 +186,26 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
          case 'A':
             inc->options |= FO_ACL;
             break;
-         case 'Z':                 /* gzip compression */
-            inc->options |= FO_GZIP;
-            inc->level = *++rp - '0';
-            Dmsg1(200, "Compression level=%d\n", inc->level);
+         case 'Z':                 /* compression */
+            rp++;                   /* skip Z */
+            if (*rp >= '0' && *rp <= '9') {
+               inc->options |= FO_COMPRESS;
+               inc->algo = COMPRESS_GZIP;
+               inc->level = *rp - '0';
+            }
+            else if (*rp == 'o') {
+               inc->options |= FO_COMPRESS;
+               inc->algo = COMPRESS_LZO1X;
+               inc->level = 1; /* not used with LZO */
+            }
+            Dmsg2(200, "Compression alg=%d level=%d\n", inc->algo, inc->level);
             break;
          case 'K':
             inc->options |= FO_NOATIME;
             break;
+         case 'X':
+            inc->options |= FO_XATTR;
+            break;
          default:
             Emsg1(M_ERROR, 0, _("Unknown include/exclude option: %c\n"), *rp);
             break;
@@ -245,8 +256,8 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
          { }
       next->next = inc;
    }
-   Dmsg3(100, "add_fname_to_include prefix=%d gzip=%d fname=%s\n", 
-         prefixed, !!(inc->options & FO_GZIP), inc->fname);
+   Dmsg4(100, "add_fname_to_include prefix=%d compres=%d alg= %d fname=%s\n", 
+         prefixed, !!(inc->options & FO_COMPRESS), inc->algo, inc->fname);
 }
 
 /*
@@ -301,7 +312,8 @@ struct s_included_file *get_next_included_file(FF_PKT *ff, struct s_included_fil
     */
    if (inc) {
       ff->flags = inc->options;
-      ff->GZIP_level = inc->level;
+      ff->Compress_algo = inc->algo;
+      ff->Compress_level = inc->level;
    }
    return inc;
 }