]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/verify.c
- Put Dmsg() on inside if() to avoid calling subroutine.
[bacula/bacula] / bacula / src / dird / verify.c
index 7fa3084aa6ae785cbd6e52f9fd29d7916264184c..bae78c22105efbc36fd78ae530a1eb6deb4425d6 100644 (file)
  *
  *   Version $Id$
  */
-
 /*
    Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as ammended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
+
 #include "bacula.h"
 #include "dird.h"
 #include "findlib/find.h"
@@ -144,14 +139,14 @@ bool do_verify_init(JCR *jcr)
         free_bsr(bsr);
         return false;
       }
-      free_ua_context(ua);
-      free_bsr(bsr);
       if (jcr->RestoreBootstrap) {
         free(jcr->RestoreBootstrap);
       }
       POOLMEM *fname = get_pool_memory(PM_MESSAGE);
-      Mmsg(fname, "%s/restore.bsr", working_directory);
+      make_unique_restore_filename(ua, &fname);
       jcr->RestoreBootstrap = bstrdup(fname);
+      free_ua_context(ua);
+      free_bsr(bsr);
       free_pool_memory(fname);
       jcr->needs_sd = true;
 
@@ -370,6 +365,10 @@ void verify_cleanup(JCR *jcr, int TermCode)
    set_jcr_job_status(jcr, TermCode);
 
    update_job_end_record(jcr);
+   if (jcr->unlink_bsr && jcr->RestoreBootstrap) {
+      unlink(jcr->RestoreBootstrap);
+      jcr->unlink_bsr = false;
+   }
 
    msg_type = M_INFO;                /* by default INFO message */
    switch (TermCode) {