]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/inc_conf.c
Ensure that StorageId is updated after write
[bacula/bacula] / bacula / src / dird / inc_conf.c
index c8a7dfa2a4d994afa274914a2b00c4551b92fed8..7df0be1a49a6517dcc2906fa87d0ef7eb9392316 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2009 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
+   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.
@@ -98,6 +98,7 @@ static RES_ITEM2 newinc_items[] = {
 static RES_ITEM options_items[] = {
    {"compression",     store_opts,    {0},     0, 0, 0},
    {"signature",       store_opts,    {0},     0, 0, 0},
+   {"basejob",         store_opts,    {0},     0, 0, 0},
    {"accurate",        store_opts,    {0},     0, 0, 0},
    {"verify",          store_opts,    {0},     0, 0, 0},
    {"onefs",           store_opts,    {0},     0, 0, 0},
@@ -128,6 +129,7 @@ static RES_ITEM options_items[] = {
    {"checkfilechanges",store_opts,    {0},     0, 0, 1},
    {"strippath",       store_opts,    {0},     0, 0, 0},
    {"honornodumpflag", store_opts,    {0},     0, 0, 0},
+   {"xattrsupport",    store_opts,    {0},     0, 0, 0},
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
@@ -139,6 +141,7 @@ enum {
    INC_KW_DIGEST,
    INC_KW_ENCRYPTION,
    INC_KW_VERIFY,
+   INC_KW_BASEJOB,
    INC_KW_ACCURATE,
    INC_KW_ONEFS,
    INC_KW_RECURSE,
@@ -157,7 +160,8 @@ enum {
    INC_KW_ENHANCEDWILD,
    INC_KW_CHKCHANGES,
    INC_KW_STRIPPATH,
-   INC_KW_HONOR_NODUMP
+   INC_KW_HONOR_NODUMP,
+   INC_KW_XATTR
 };
 
 /*
@@ -171,6 +175,7 @@ static struct s_kw FS_option_kw[] = {
    {"signature",   INC_KW_DIGEST},
    {"encryption",  INC_KW_ENCRYPTION},
    {"verify",      INC_KW_VERIFY},
+   {"basejob",     INC_KW_BASEJOB},
    {"accurate",    INC_KW_ACCURATE},
    {"onefs",       INC_KW_ONEFS},
    {"recurse",     INC_KW_RECURSE},
@@ -188,8 +193,9 @@ static struct s_kw FS_option_kw[] = {
    {"noatime",     INC_KW_NOATIME},
    {"enhancedwild", INC_KW_ENHANCEDWILD},
    {"checkfilechanges", INC_KW_CHKCHANGES},
-   {"strippath",    INC_KW_STRIPPATH},
-   {"honornodumpflag",    INC_KW_HONOR_NODUMP},
+   {"strippath",   INC_KW_STRIPPATH},
+   {"honornodumpflag", INC_KW_HONOR_NODUMP},
+   {"xattrsupport", INC_KW_XATTR},
    {NULL,          0}
 };
 
@@ -222,6 +228,7 @@ static struct s_fs_opt FS_options[] = {
    {"gzip7",    INC_KW_COMPRESSION,  "Z7"},
    {"gzip8",    INC_KW_COMPRESSION,  "Z8"},
    {"gzip9",    INC_KW_COMPRESSION,  "Z9"},
+   {"lzo",      INC_KW_COMPRESSION,  "Zo"},
    {"blowfish", INC_KW_ENCRYPTION,    "B"},   /* ***FIXME*** not implemented */
    {"3des",     INC_KW_ENCRYPTION,    "3"},   /* ***FIXME*** not implemented */
    {"yes",      INC_KW_ONEFS,         "0"},
@@ -259,6 +266,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_CHKCHANGES,    "0"},
    {"yes",      INC_KW_HONOR_NODUMP,  "N"},
    {"no",       INC_KW_HONOR_NODUMP,  "0"},
+   {"yes",      INC_KW_XATTR,         "X"},
+   {"no",       INC_KW_XATTR,         "0"},
    {NULL,       0,                      0}
 };
 
@@ -272,14 +281,14 @@ static struct s_fs_opt FS_options[] = {
  */
 static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
 {
-   int token, i;
+   int i;
    char option[3];
    int lcopts = lc->options;
 
    option[0] = 0;                     /* default option = none */
    option[2] = 0;                     /* terminate options */
    lc->options |= LOPT_STRING;        /* force string */
-   token = lex_get_token(lc, T_STRING);          /* expect at least one option */
+   lex_get_token(lc, T_STRING);       /* expect at least one option */
    if (keyword == INC_KW_VERIFY) { /* special case */
       /* ***FIXME**** ensure these are in permitted set */
       bstrncat(opts, "V", optlen);         /* indicate Verify */
@@ -292,6 +301,12 @@ 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_BASEJOB) { /* special case */
+      /* ***FIXME**** ensure these are in permitted set */
+      bstrncat(opts, "J", optlen);         /* indicate BaseJob */
+      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);
@@ -324,7 +339,7 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
 
    /* If option terminated by comma, eat it */
    if (lc->ch == ',') {
-      token = lex_get_token(lc, T_ALL);      /* yes, eat comma */
+      lex_get_token(lc, T_ALL);      /* yes, eat comma */
    }
 }
 
@@ -476,9 +491,8 @@ static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass)
 /* Store Base info */
 static void store_base(LEX *lc, RES_ITEM *item, int index, int pass)
 {
-   int token;
 
-   token = lex_get_token(lc, T_NAME);
+   lex_get_token(lc, T_NAME);
    if (pass == 1) {
       /*
        * Pickup Base Job Name
@@ -491,9 +505,8 @@ static void store_base(LEX *lc, RES_ITEM *item, int index, int pass)
 /* Store reader info */
 static void store_plugin(LEX *lc, RES_ITEM *item, int index, int pass)
 {
-   int token;
 
-   token = lex_get_token(lc, T_NAME);
+   lex_get_token(lc, T_NAME);
    if (pass == 1) {
       /*
        * Pickup plugin command
@@ -575,15 +588,14 @@ static void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass)
 /* Store exclude directory containing  info */
 static void store_excludedir(LEX *lc, RES_ITEM2 *item, int index, int pass, bool exclude)
 {
-   int token;
 
    if (exclude) {
       scan_err0(lc, _("ExcludeDirContaining directive not permitted in Exclude.\n"));
       /* NOT REACHED */
    }
-   token = lex_get_token(lc, T_NAME);
+   lex_get_token(lc, T_NAME);
    if (pass == 1) {
-      res_incexe.current_opts->ignoredir = bstrdup(lc->str);
+      res_incexe.ignoredir = bstrdup(lc->str);
    }
    scan_to_eol(lc);
 }