From: Eric Bollengier Date: Tue, 11 Aug 2015 13:26:23 +0000 (+0200) Subject: Use Client Catalog resource in get_catalog_resource() if "client" is specified in... X-Git-Tag: Release-7.4.0~109 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=46ccca3e14c0b1f0386a3e8ab2a4d7159c907e53;p=bacula%2Fbacula Use Client Catalog resource in get_catalog_resource() if "client" is specified in command line --- diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index f091707093..d7efcf98f0 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -227,6 +227,7 @@ CAT *get_catalog_resource(UAContext *ua) { char name[MAX_NAME_LENGTH]; CAT *catalog = NULL; + CLIENT *client = NULL; int i; for (i=1; iargc; i++) { @@ -236,6 +237,15 @@ CAT *get_catalog_resource(UAContext *ua) break; } } + if (strcasecmp(ua->argk[i], NT_("client")) == 0 && ua->argv[i]) { + if (acl_access_ok(ua, Client_ACL, ua->argv[i])) { + client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]); + break; + } + } + } + if (!catalog && client) { /* Try to take the catalog from the client */ + catalog = client->catalog; } if (ua->gui && !catalog) { LockRes();