]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bug #1587 if you have clients with different catalogs configured, both catalogs...
authorKern Sibbald <kern@sibbald.com>
Sat, 26 Jun 2010 11:07:24 +0000 (13:07 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:57 +0000 (16:53 +0200)
bacula/src/dird/dird.c

index d71f9da6ed296e83a7b623cadc1ace8d9feca040..fadba9eb9642754e01c0b04d4f489b946f670e05 100644 (file)
@@ -1003,6 +1003,14 @@ static bool check_catalog(cat_op mode)
       CLIENT *client;
       foreach_res(client, R_CLIENT) {
          CLIENT_DBR cr;
+         /* Create clients only if they use the current catalog */
+         if (client->catalog != catalog) {
+            Dmsg3(500, "Skip client=%s with cat=%s not catalog=%s\n",
+                  client->name(), client->catalog->name(), catalog->name());
+            continue;
+         }
+         Dmsg2(500, "create cat=%s for client=%s\n", 
+               client->catalog->name(), client->name());
          memset(&cr, 0, sizeof(cr));
          bstrncpy(cr.Name, client->name(), sizeof(cr.Name));
          db_create_client_record(NULL, db, &cr);