]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/inc_conf.c
Turn off debug
[bacula/bacula] / bacula / src / dird / inc_conf.c
index f0b9c144b12791c8fed4f171b3015ca2fe7d97a9..19651f6f1f5da80fc484a31f3915a568abc2f438 100644 (file)
@@ -1,3 +1,30 @@
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2007 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.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   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
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 /*
  *   Configuration file parser for new and old Include and
  *      Exclude records
  *
  *     Version $Id$
  */
-/*
-   Copyright (C) 2003-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
 
 #include "bacula.h"
 #include "dird.h"
 #ifndef HAVE_REGEX_H
-#include "lib/regex.h"
+#include "lib/bregex.h"
 #else
 #include <regex.h>
 #endif
@@ -107,6 +120,8 @@ static RES_ITEM options_items[] = {
    {"noatime",         store_opts,    {0},     0, 0, 0},
    {"enhancedwild",    store_opts,    {0},     0, 0, 0},
    {"drivetype",       store_drivetype, {0},     0, 0, 0},
+   {"checkfilechanges",store_opts,    {0},     0, 0, 0},
+   {"strippath",       store_opts,    {0},     0, 0, 0},
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
@@ -132,7 +147,9 @@ enum {
    INC_KW_IGNORECASE,
    INC_KW_HFSPLUS,
    INC_KW_NOATIME,
-   INC_KW_ENHANCEDWILD
+   INC_KW_ENHANCEDWILD,
+   INC_KW_CHKCHANGES,
+   INC_KW_STRIPPATH
 };
 
 /*
@@ -161,6 +178,8 @@ static struct s_kw FS_option_kw[] = {
    {"hfsplussupport", INC_KW_HFSPLUS},
    {"noatime",     INC_KW_NOATIME},
    {"enhancedwild", INC_KW_ENHANCEDWILD},
+   {"checkfilechanges", INC_KW_CHKCHANGES},
+   {"strippath",    INC_KW_STRIPPATH},
    {NULL,          0}
 };
 
@@ -226,6 +245,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_NOATIME,       "0"},
    {"yes",      INC_KW_ENHANCEDWILD,  "K"},
    {"no",       INC_KW_ENHANCEDWILD,  "0"},
+   {"yes",      INC_KW_CHKCHANGES,    "c"},
+   {"no",       INC_KW_CHKCHANGES,    "0"},
    {NULL,       0,                      0}
 };
 
@@ -253,7 +274,14 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
       bstrncat(opts, lc->str, optlen);
       bstrncat(opts, ":", optlen);         /* terminate it */
       Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
-
+   } else if (keyword == INC_KW_STRIPPATH) { /* another special case */
+      if (!is_an_integer(lc->str)) {
+         scan_err1(lc, _("Expected a strip path positive integer, got:%s:"), lc->str);
+      }
+      bstrncat(opts, "P", optlen);         /* indicate strip path */
+      bstrncat(opts, lc->str, optlen);
+      bstrncat(opts, ":", optlen);         /* terminate it */
+      Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
    /*
     * Standard keyword options for Include/Exclude
     */
@@ -495,7 +523,7 @@ static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass)
             res_incexe.current_opts->wilddir.append(bstrdup(lc->str));
             newsize = res_incexe.current_opts->wilddir.size();
          } else if (item->code == 2) {
-            if (strchr(lc->str, '/') != NULL) {
+            if (strpbrk(lc->str, "/\\") != NULL) {
                type = "wildfile";
                res_incexe.current_opts->wildfile.append(bstrdup(lc->str));
                newsize = res_incexe.current_opts->wildfile.size();