]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/verify.c
- Back port changes to 1.38.5
[bacula/bacula] / bacula / src / dird / verify.c
index 8081532727a3222543a380cc8d94a9616087183c..45b0246a5856f54b2fc9a35f765bac26fdf9eba2 100644 (file)
@@ -14,7 +14,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -43,6 +43,7 @@ static char storaddr[]     = "storage address=%s port=%d ssl=0\n";
 /* Responses received from File daemon */
 static char OKverify[]    = "2000 OK verify\n";
 static char OKstore[]     = "2000 OK storage\n";
+static char OKbootstrap[] = "2000 OK bootstrap\n";
 
 /* Forward referenced functions */
 static void prt_fname(JCR *jcr);
@@ -125,34 +126,9 @@ bool do_verify_init(JCR *jcr)
     *   File daemon but not used).
     */
    if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
-      RESTORE_CTX rx;
-      UAContext *ua;
-      memset(&rx, 0, sizeof(rx));
-      rx.bsr = new_bsr();
-      rx.JobIds = "";                       
-      rx.bsr->JobId = jcr->target_jr.JobId;
-      ua = new_ua_context(jcr);
-      complete_bsr(ua, rx.bsr);
-      rx.bsr->fi = new_findex();
-      rx.bsr->fi->findex = 1;
-      rx.bsr->fi->findex2 = jcr->target_jr.JobFiles;
-      jcr->ExpectedFiles = write_bsr_file(ua, rx);
-      if (jcr->ExpectedFiles == 0) {
-         free_ua_context(ua);
-         free_bsr(rx.bsr);
+      if (!create_restore_bootstrap_file(jcr)) {
          return false;
       }
-      if (jcr->RestoreBootstrap) {
-         free(jcr->RestoreBootstrap);
-      }
-      POOLMEM *fname = get_pool_memory(PM_MESSAGE);
-      make_unique_restore_filename(ua, &fname);
-      jcr->RestoreBootstrap = bstrdup(fname);
-      free_ua_context(ua);
-      free_bsr(rx.bsr);
-      free_pool_memory(fname);
-      jcr->needs_sd = true;
-
    } else {
       jcr->sd_auth_key = bstrdup("dummy");    /* dummy Storage daemon key */
    }
@@ -208,6 +184,10 @@ bool do_verify(JCR *jcr)
          return false;
       }
       Dmsg0(50, "Storage daemon connection OK\n");
+
+      if (!bnet_fsend(jcr->store_bsock, "run")) {
+         return false;
+      }
    }
    /*
     * OK, now connect to the File daemon
@@ -258,7 +238,8 @@ bool do_verify(JCR *jcr)
       /*
        * Send the bootstrap file -- what Volumes/files to restore
        */
-      if (!send_bootstrap_file(jcr)) {
+      if (!send_bootstrap_file(jcr, fd) ||
+          !response(jcr, fd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) {
          return false;
       }