From 46ccca3e14c0b1f0386a3e8ab2a4d7159c907e53 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 11 Aug 2015 15:26:23 +0200 Subject: [PATCH] Use Client Catalog resource in get_catalog_resource() if "client" is specified in command line --- bacula/src/dird/ua_select.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(); -- 2.39.5