From: Kern Sibbald Date: Sat, 26 Jun 2010 11:07:24 +0000 (+0200) Subject: Fix bug #1587 if you have clients with different catalogs configured, both catalogs... X-Git-Tag: Release-5.2.1~1237 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd514106959bd8bf28ab41874ad2ef4560827648;p=bacula%2Fbacula Fix bug #1587 if you have clients with different catalogs configured, both catalogs contains all clients after a reload or restart of the dir --- diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index d71f9da6ed..fadba9eb96 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -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);