]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/dird.c
Ensure that StorageId is updated after write
[bacula/bacula] / bacula / src / dird / dird.c
index c00ec5e53282527e3f0e33d8b873d4567b6c9fab..c897b6e50cf3f73c7ce416f1a6446a0a3e95e561 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2012 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.
@@ -1021,15 +1021,15 @@ static bool check_catalog(cat_op mode)
       STORE *store;
       foreach_res(store, R_STORAGE) {
          STORAGE_DBR sr;
-         MEDIATYPE_DBR mr;
+         MEDIATYPE_DBR mtr;
          memset(&sr, 0, sizeof(sr));
-         memset(&mr, 0, sizeof(mr));
+         memset(&mtr, 0, sizeof(mtr));
          if (store->media_type) {
-            bstrncpy(mr.MediaType, store->media_type, sizeof(mr.MediaType));
-            mr.ReadOnly = 0;
-            db_create_mediatype_record(NULL, db, &mr);
+            bstrncpy(mtr.MediaType, store->media_type, sizeof(mtr.MediaType));
+            mtr.ReadOnly = 0;
+            db_create_mediatype_record(NULL, db, &mtr);
          } else {
-            mr.MediaTypeId = 0;
+            mtr.MediaTypeId = 0;
          }
          bstrncpy(sr.Name, store->name(), sizeof(sr.Name));
          sr.AutoChanger = store->autochanger;
@@ -1119,16 +1119,6 @@ static bool check_catalog(cat_op mode)
       /* Set type in global for debugging */
       set_db_type(db_get_type(db));
 
-#ifdef BEEF_DEMO
-      /*
-       * Demo mode only allows SQLite3
-       */
-      if (!bstrcmp(db_get_type(db), "SQLite3")) {
-         Jmsg(NULL, M_FATAL, 0, _("Failed to initialize database backend\n"));
-         OK = false;
-      }
-#endif
-
       db_close_database(NULL, db);
    }
    return OK;
@@ -1154,7 +1144,7 @@ static void cleanup_old_files()
    POOLMEM *cleanup = get_pool_memory(PM_MESSAGE);
    POOLMEM *results = get_pool_memory(PM_MESSAGE);
    copy_base_name(cleanup);
-   pm_strcat(cleanup, "*.bsr");
+   pm_strcat(cleanup, "*.restore.*.bsr");
    run_program(cleanup, 0, results);
    copy_base_name(cleanup);
    pm_strcat(cleanup, "*.mail");