]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/match.c
Second cut plugin filesets
[bacula/bacula] / bacula / src / findlib / match.c
index 90b9041aea393b5a8b8ec405c9b5d1310677e211..93a3b466e6da0d987d4ce4a7360aaf65ae482516 100644 (file)
@@ -1,28 +1,14 @@
-/*
- *     Old style 
- *
- *  Routines used to keep and match include and exclude
- *   filename/pathname patterns.
- *
- *  Note, this file is used for the old style include and
- *   excludes, so is deprecated. The new style code is
- *   found in find.c.   
- *  This code is still used for lists in testls and bextract.
- *
- *   Kern E. Sibbald, December MMI
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 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.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *     Old style 
+ *
+ *  Routines used to keep and match include and exclude
+ *   filename/pathname patterns.
+ *
+ *  Note, this file is used for the old style include and
+ *   excludes, so is deprecated. The new style code is
+ *   found in find.c.   
+ *  This code is still used for lists in testls and bextract.
+ *
+ *   Kern E. Sibbald, December MMI
+ *
+ */
 
 #include "bacula.h"
 #include "find.h"
 
-#include <pwd.h>
-#include <grp.h>
 #include <sys/types.h>
 
 #ifndef FNM_LEADING_DIR
@@ -64,9 +62,9 @@ static const int fnmode = 0;
 
 
 int
-match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool), void *his_pkt)
+match_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *, FF_PKT *ff_pkt, bool))
 {
-   ff->callback = callback;
+   ff->file_save = file_save;
 
    struct s_included_file *inc = NULL;
 
@@ -76,7 +74,7 @@ match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool)
       bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
       Dmsg1(100, "find_files: file=%s\n", inc->fname);
       if (!file_is_excluded(ff, inc->fname)) {
-         if (find_one_file(jcr, ff, callback, his_pkt, inc->fname, (dev_t)-1, 1) ==0) {
+         if (find_one_file(jcr, ff, file_save, inc->fname, (dev_t)-1, 1) ==0) {
             return 0;                  /* error return */
          }
       }
@@ -195,6 +193,9 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
          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,7 +246,8 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
          { }
       next->next = inc;
    }
-   Dmsg1(50, "add_fname_to_include fname=%s\n", inc->fname);
+   Dmsg3(100, "add_fname_to_include prefix=%d gzip=%d fname=%s\n", 
+         prefixed, !!(inc->options & FO_GZIP), inc->fname);
 }
 
 /*