]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/stored_conf.c
Remove broken run when code
[bacula/bacula] / bacula / src / stored / stored_conf.c
index 51b7dd76b7e9fe57a3862a707921f5547ebfa187..1f1cded7b4be52473c1efda8b3d0d36fea124fe9 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 Bacula Storage daemon
  *
  *
  *   Version $Id$
  */
-/*
-   Copyright (C) 2000-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 "stored.h"
 
-extern int debug_level;
-
-
 /* First and last resource ids */
 int r_first = R_FIRST;
 int r_last  = R_LAST;
@@ -39,7 +49,13 @@ static void store_devtype(LEX *lc, RES_ITEM *item, int index, int pass);
 
 /* We build the current resource here statically,
  * then move it to dynamic memory */
+#if defined(_MSC_VER)
+extern "C" { // work around visual compiler mangling variables
+    URES res_all;
+}
+#else
 URES res_all;
+#endif
 int res_all_size = sizeof(res_all);
 
 /* Definition of records permitted within each
@@ -70,6 +86,7 @@ static RES_ITEM store_items[] = {
    {"tlskey",                store_dir,       ITEM(res_store.tls_keyfile), 0, 0, 0},
    {"tlsdhfile",             store_dir,       ITEM(res_store.tls_dhfile), 0, 0, 0},
    {"tlsallowedcn",          store_alist_str, ITEM(res_store.tls_allowed_cns), 0, 0, 0},
+   {"clientconnectwait",     store_time,  ITEM(res_store.client_wait), 0, ITEM_DEFAULT, 30 * 60},
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
@@ -592,7 +609,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
          if ((errstat = pthread_mutex_init(&res->res_changer.changer_mutex, NULL)) != 0) {
             berrno be;
             Jmsg1(NULL, M_ERROR_TERM, 0, _("Unable to init mutex: ERR=%s\n"), 
-                  be.strerror(errstat));
+                  be.bstrerror(errstat));
          }
          break;
       default:
@@ -643,16 +660,17 @@ void save_resource(int type, RES_ITEM *items, int pass)
       if (!res_head[rindex]) {
          res_head[rindex] = (RES *)res; /* store first entry */
       } else {
-         RES *next;
+         RES *next, *last;
          /* Add new res to end of chain */
-         for (next=res_head[rindex]; next->next; next=next->next) {
+         for (last=next=res_head[rindex]; next; next=next->next) {
+            last = next;
             if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
                Emsg2(M_ERROR_TERM, 0,
                   _("Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n"),
                   resources[rindex].name, res->res_dir.hdr.name);
             }
          }
-         next->next = (RES *)res;
+         last->next = (RES *)res;
          Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
                res->res_dir.hdr.name);
       }