From: Eric Bollengier Date: Mon, 16 Nov 2020 12:58:55 +0000 (+0100) Subject: Fix restore objectid= command X-Git-Tag: Release-11.3.2~837 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5f7db5f32c4d82038bfb6050b3537c8762e3f33;p=thirdparty%2Fbacula.git Fix restore objectid= command The ua->cmd variable is overwritten by the get_client_name() call --- diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 8e764e7f5..55eb10c4d 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -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;