]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
tweak messages and dmsg for vol encryption
authorAlain Spineux <alain@baculasystems.com>
Tue, 15 Nov 2022 14:02:58 +0000 (15:02 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
- fix Dmsg(0,
- from \"load Volume %s\" to  Volume \"%s\"
- add the "operation" in the error message

bacula/src/stored/dev.c

index 43306cfedccf5d1d6304f2b1281d90f9c09758ef..5b1b8eb3d14d9e5aa04b5a2e0f2ab41abebc3ee3 100644 (file)
@@ -1185,7 +1185,7 @@ bool DEVICE::load_encryption_key(DCR *dcr, const char *operation,
 {
    enum { op_none, op_label, op_read };
    bool ok = true; // No error
-   Dmsg4(0, "load_encryption_key %s %s enc=%ld ver=%d\n", operation, volume_name, device->volume_encryption, VolHdr.BlockVer);
+   Dmsg4(100, "load_encryption_key %s %s enc=%ld ver=%d\n", operation, volume_name, device->volume_encryption, VolHdr.BlockVer);
    int op = op_none;
    if (0 == strcmp(operation, "LABEL")) {
       op = op_label;
@@ -1390,20 +1390,20 @@ bool DEVICE::load_encryption_key(DCR *dcr, const char *operation,
       /* initialize the crypto context */
       crypto_device_ctx = block_cipher_context_new(cipher);
       block_cipher_init_key(crypto_device_ctx, (unsigned char*)keybuf);
-      Jmsg(jcr, M_INFO, 0, _("3305 LoadEncryptionKey \"for Volume %s\", status is OK.\n"),
+      Jmsg(jcr, M_INFO, 0, _("3305 LoadEncryptionKey for Volume \"%s\", status is OK.\n"),
             dcr->VolumeName);
       if (comment!=NULL) {
          /* ignored for now */
       }
-      Dmsg1(20, "load encryption key for volume %s OK\n", dcr->VolumeName);
+      Dmsg1(60, "load encryption key for volume %s OK\n", dcr->VolumeName);
    }
    if (err_msg.c_str()[0] != '\0') {
       Dmsg2(10, "load encryption key for volume %s Err=%s\n", dcr->VolumeName, err_msg.c_str());
-      Jmsg(jcr, M_FATAL, 0, _("3992 Bad LoadEncryptionKey \"load Volume %s\": "
-           "ERR=%s\n"), dcr->VolumeName, err_msg.c_str());
+      Jmsg(jcr, M_FATAL, 0, _("3992 Bad LoadEncryptionKey %s Volume \"%s\": "
+           "ERR=%s\n"), operation, dcr->VolumeName, err_msg.c_str());
       if (jcr != NULL) {
-         Mmsg(jcr->errmsg, _("3992 Bad LoadEncryptionKey \"load Volume %s\": "
-               "ERR=%s\n"), dcr->VolumeName, err_msg.c_str());
+         Mmsg(jcr->errmsg, _("3992 Bad LoadEncryptionKey %s Volume \"%s\": "
+               "ERR=%s\n"), operation, dcr->VolumeName, err_msg.c_str());
       }
       ok = false;
    } else {