From: Kern Sibbald Date: Sun, 27 May 2018 17:44:09 +0000 (+0200) Subject: Fix bug #2212 where restore jobid=nn file=xxx restores the files twice X-Git-Tag: Release-9.2.0~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5bdfcd9c804e2c189fac570e096e0dc249f4f648;p=thirdparty%2Fbacula.git Fix bug #2212 where restore jobid=nn file=xxx restores the files twice --- diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index b5b8dac2c8..04bd5ae8a5 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -1005,6 +1005,13 @@ static bool insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *f } else { Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date, rx->path, rx->fname, rx->ClientName); + /* + * Note: we have just edited the JobIds into the query, so + * we need to clear JobIds, or they will be added + * back into JobIds with the query below, and then + * restored twice. Fixes bug #2212. + */ + rx->JobIds[0] = 0; } rx->found = false; /* Find and insert jobid and File Index */