]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix connection information in verify and virtualfull jobs
authorEric Bollengier <eric@baculasystems.com>
Tue, 20 Dec 2022 09:02:15 +0000 (10:02 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
bacula/src/dird/vbackup.c
bacula/src/dird/verify.c

index c5efe17a7e9192d46eb8bd7e36247b60d7fdcba9..a1606e85c90f114806e1d9c5012e024f269db061 100644 (file)
@@ -122,7 +122,7 @@ bool do_vbackup(JCR *jcr)
    db_list_ctx jobids;
    UAContext *ua;
    bootstrap_info info;
-
+   POOL_MEM buf;
    Dmsg2(100, "rstorage=%p wstorage=%p\n", jcr->store_mngr->get_rstore_list(), jcr->store_mngr->get_wstore_list());
    Dmsg2(100, "Read store=%s, write store=%s\n",
       ((STORE *)jcr->store_mngr->get_rstore_list()->first())->name(),
@@ -346,6 +346,11 @@ _("This Job is not an Accurate backup so is not equivalent to a Full backup.\n")
       return false;
    }
    sd = jcr->store_bsock;
+   build_connecting_info_log(_("Storage"), jcr->store_mngr->get_rstore()->name(),
+                             get_storage_address(jcr->client, jcr->store_mngr->get_rstore()),
+                             jcr->store_mngr->get_rstore()->SDport,
+                             sd->tls ? true : false, buf.addr());
+   Jmsg(jcr, M_INFO, 0, "%s", buf.c_str());
 
    /*
     * Now start a job with the Storage daemon
index 0800b3b92d64767a6efc161b1c051ad8f9b6cf86..07a4d5a7a91a6b2216fcb01cbfe11a06b731cfc1 100644 (file)
@@ -96,6 +96,7 @@ bool do_verify(JCR *jcr)
    uint32_t store_port;
    const char *Name;
    STORE *rstore = jcr->store_mngr->get_rstore();
+   POOL_MEM buf, tmp;
 
    jcr->store_mngr->reset_wstorage();
 
@@ -182,7 +183,6 @@ bool do_verify(JCR *jcr)
           !jcr->previous_jr.PurgedFiles  &&
            jcr->job->CheckMalware)
       {
-         POOL_MEM buf;
          Jmsg(jcr, M_INFO, 0, _("[DI0002] Checking file metadata for Malwares\n"));
          edit_int64(jcr->previous_jr.JobId, ed1);
          if (check_malware(jcr, ed1, buf.handle()) != 0) {
@@ -277,13 +277,18 @@ bool do_verify(JCR *jcr)
          Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg);
          return false;
       }
+      sd = jcr->store_bsock;
+      build_connecting_info_log(_("Storage"), jcr->store_mngr->get_rstore()->name(),
+                                get_storage_address(jcr->client, jcr->store_mngr->get_rstore()),
+                                jcr->store_mngr->get_rstore()->SDport,
+                                jcr->store_bsock->tls ? true : false, buf.addr());
+      Jmsg(jcr, M_INFO, 0, "%s", buf.c_str());
       /*
        * Now start a job with the Storage daemon
        */
       if (!start_storage_daemon_job(jcr, jcr->store_mngr->get_rstore_list(), NULL, true /* wait */)) {
          return false;
       }
-      sd = jcr->store_bsock;
       jcr->sd_calls_client = jcr->client->sd_calls_client;
       /*
        * Send the bootstrap file -- what Volumes/files to restore
@@ -311,14 +316,11 @@ bool do_verify(JCR *jcr)
    jcr->setJobStatus(JS_Running);
    fd = jcr->file_bsock;
 
-   {
-      POOL_MEM buf, tmp;
-      /* Print connection info only for real jobs */
-      build_connecting_info_log(_("Client"), jcr->client->name(),
-                                get_client_address(jcr, jcr->client, tmp.addr()), jcr->client->FDport,
-                                fd->tls ? true : false, buf.addr());
-      Jmsg(jcr, M_INFO, 0, "%s", buf.c_str());
-   }
+   /* Print connection info only for real jobs */
+   build_connecting_info_log(_("Client"), jcr->client->name(),
+                             get_client_address(jcr, jcr->client, tmp.addr()), jcr->client->FDport,
+                             fd->tls ? true : false, buf.addr());
+   Jmsg(jcr, M_INFO, 0, "%s", buf.c_str());
 
    Dmsg0(30, ">filed: Send include list\n");
    if (!send_include_list(jcr)) {