]> git.sur5r.net Git - bacula/bacula/commitdiff
Create Client record in database at startup -- makes bat work better
authorKern Sibbald <kern@sibbald.com>
Sat, 23 May 2009 20:44:37 +0000 (20:44 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 23 May 2009 20:44:37 +0000 (20:44 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8858 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dird.c
bacula/technotes

index edf4a650be912507c93a99294722cfba2b63fa5b..fc59364e1f084ba1a9d91c7d457cdba8a3243d5c 100644 (file)
@@ -961,10 +961,22 @@ static bool check_catalog()
          }
       }
 
+      /* Ensure basic client record is in DB */
+      CLIENT *client;
+      foreach_res(client, R_CLIENT) {
+         CLIENT_DBR cr;
+         memset(&cr, 0, sizeof(cr));
+         bstrncpy(cr.Name, client->name(), sizeof(cr.Name));
+         db_create_client_record(NULL, db, &cr);
+      }
+
+      /* Ensure basic storage record is in DB */
       STORE *store;
       foreach_res(store, R_STORAGE) {
          STORAGE_DBR sr;
          MEDIATYPE_DBR mr;
+         memset(&sr, 0, sizeof(sr));
+         memset(&mr, 0, sizeof(mr));
          if (store->media_type) {
             bstrncpy(mr.MediaType, store->media_type, sizeof(mr.MediaType));
             mr.ReadOnly = 0;
index 17336fc8a75c461281726f7677706a46543e2262..3a70e7b2f5f619c55155da823b30810f2e608e4b 100644 (file)
@@ -3,8 +3,8 @@
 General:
 
 23May09
+kes  Create Client record in database at startup -- makes bat work better.
 kes  Turn off useless End of file message during restore.
-=======
 kes  When doing a tree selection restore, look at the PurgedFiles column
      in the first JobId, and if non-zero, the Job was purged, so do
      not do selection.