]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #10752 storage option on the restore command line not working
authorAlain Spineux <alain@baculasystems.com>
Fri, 16 Feb 2024 11:44:00 +0000 (12:44 +0100)
committerEric Bollengier <eric@baculasystems.com>
Mon, 19 Feb 2024 12:50:02 +0000 (13:50 +0100)
- restore **storage=File** is ignored

bacula/src/dird/ua_restore.c

index b1f8dc239003039265a5d7373c9a0ac984978e4c..866ff4a75b9cc2093470257fab1550b1f090b0ae 100644 (file)
@@ -208,6 +208,18 @@ int restore_cmd(UAContext *ua, const char *cmd)
             goto bail_out;
          }
          rx.job_group = ua->argv[i];
+      } else if (strcasecmp(ua->argk[i], "storage") == 0) {
+         STORE *store;
+         LockRes();
+         foreach_res(store, R_STORAGE) {
+            if (strcasecmp(ua->argv[i], store->name()) == 0 &&
+                store->is_enabled() &&
+                acl_access_ok(ua, Storage_ACL, store->name())) {
+               rx.store = store;
+               break;
+            }
+         }
+         UnlockRes();
       }
    }