-
-}
-
-
-#ifdef xxxx_needed
-static void get_storage_from_mediatype(UAContext *ua, NAME_LIST *name_list, RESTORE_CTX *rx)
-{
- STORE *store;
-
- if (name_list->num_ids > 1) {
- bsendmsg(ua, _("Warning, the JobIds that you selected refer to more than one MediaType.\n"
- "Restore may not be possible. The MediaTypes used are:\n"));
- print_name_list(ua, name_list);
-// rx->store = select_storage_resource(ua);
- return;
- }
-
- if (name_list->num_ids == 0) {
- bsendmsg(ua, _("No MediaType found for your JobIds.\n"));
- rx->store = select_storage_resource(ua);
- return;
- }
- if (rx->store) {
- return;
- }
- /*
- * We have a single MediaType, look it up in our Storage resource
- */
- LockRes();
- foreach_res(store, R_STORAGE) {
- if (strcmp(name_list->name[0], store->media_type) == 0) {
- if (acl_access_ok(ua, Storage_ACL, store->hdr.name)) {
- rx->store = store;
- }
- break;
- }
- }
- UnlockRes();
-
- if (rx->store) {
- /* Check if an explicit storage resource is given */
- store = NULL;
- int i = find_arg_with_value(ua, "storage");
- if (i > 0) {
- store = (STORE *)GetResWithName(R_STORAGE, ua->argv[i]);
- if (store && !acl_access_ok(ua, Storage_ACL, store->hdr.name)) {
- store = NULL;
- }
- }
- if (store && (store != rx->store)) {
- bsendmsg(ua, _("Warning default storage overridden by %s on command line.\n"),
- store->hdr.name);
- rx->store = store;
- }
- return;