]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix restore objectid= command
authorEric Bollengier <eric@baculasystems.com>
Mon, 16 Nov 2020 12:58:55 +0000 (13:58 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
The ua->cmd variable is overwritten by the get_client_name() call

bacula/src/dird/ua_restore.c

index 8e764e7f53dc0b77a00562aed027651c4baeb83d..55eb10c4dc95c60edc9aedde57e7d48767e8cd5f 100644 (file)
@@ -589,13 +589,6 @@ static int select_files_from_plugin_obj(UAContext *ua, OBJECT_DBR *obj_r, RESTOR
       return 0;
    }
 
-   bool dir = obj_r->Filename[0] != 0 ? false : true;
-   if (dir) {
-      pm_strcpy(ua->cmd, obj_r->Path);
-   } else {
-      Mmsg(ua->cmd, "%s%s", obj_r->Path, obj_r->Filename);
-   }
-
    db_list_ctx jobids;
    if (!db_get_accurate_jobids(ua->jcr, ua->db, &jr, &jobids)) {
       return 0;
@@ -612,6 +605,13 @@ static int select_files_from_plugin_obj(UAContext *ua, OBJECT_DBR *obj_r, RESTOR
       return 0;
    }
 
+   bool dir = obj_r->Filename[0] != 0 ? false : true;
+   if (dir) {
+      pm_strcpy(ua->cmd, obj_r->Path);
+   } else {
+      Mmsg(ua->cmd, "%s%s", obj_r->Path, obj_r->Filename);
+   }
+
    insert_one_file_or_dir(ua, rx, jr.cStartTime, dir);
 
    return 1;