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.0.8~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6bbdc671c95ad8116f14ecb5ef60a1ecb6917de6;p=bacula%2Fbacula 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 892a20d8b7..85979b8d62 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -1001,6 +1001,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 */