]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bug #2212 where restore jobid=nn file=xxx restores the files twice
authorKern Sibbald <kern@sibbald.com>
Sun, 27 May 2018 17:44:09 +0000 (19:44 +0200)
committerKern Sibbald <kern@sibbald.com>
Sun, 27 May 2018 17:44:09 +0000 (19:44 +0200)
bacula/src/dird/ua_restore.c

index 892a20d8b74773b8cbb60e18280fa523b3721d21..85979b8d62a76da3b431400f8ea1a9507f3c3a55 100644 (file)
@@ -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 */