From: Kern Sibbald Date: Wed, 26 Sep 2007 10:54:21 +0000 (+0000) Subject: Return insert attributes error message in db msg buffer to avoid X-Git-Tag: Release-3.0.0~2456 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=890941a99d34abaabcb8b7c71071ec52dac62cea;p=bacula%2Fbacula Return insert attributes error message in db msg buffer to avoid false error messages. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5650 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 80bc523822..2c8d52c4a2 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -847,20 +847,23 @@ bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) mdb->db_socket, 1 /* multi_db = true */); if (!jcr->db_batch) { - Jmsg1(jcr, M_FATAL, 0, _("Could not init batch database: \"%s\".\n"), - jcr->db->db_name); + Mmsg1(&mdb->errmsg, _("Could not init batch database: \"%s\".\n"), + jcr->db->db_name); + Jmsg1(jcr, M_FATAL, 0, "%s", mdb->errmsg); return false; } if (!db_open_database(jcr, jcr->db_batch)) { - Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\": ERR=%s.\n"), + Mmsg2(&mdb->errmsg, _("Could not open database \"%s\": ERR=%s.\n"), jcr->db->db_name, db_strerror(jcr->db_batch)); + Jmsg1(jcr, M_FATAL, 0, "%s", mdb->errmsg); return false; } if (!sql_batch_start(jcr, jcr->db_batch)) { - Jmsg(jcr, M_FATAL, 0, + Mmsg1(&mdb->errmsg, "Can't start batch mode: ERR=%s", db_strerror(jcr->db_batch)); + Jmsg1(jcr, M_FATAL, 0, "%s", mdb->errmsg); return false; } Dmsg3(100, "initdb ref=%d connected=%d db=%p\n", jcr->db_batch->ref_count, @@ -873,10 +876,10 @@ bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) */ if (!(ar->Stream == STREAM_UNIX_ATTRIBUTES || ar->Stream == STREAM_UNIX_ATTRIBUTES_EX)) { - Mmsg1(&bdb->errmsg, _("Attempt to put non-attributes into catalog. Stream=%d\n"), + Mmsg1(&mdb->errmsg, _("Attempt to put non-attributes into catalog. Stream=%d\n"), ar->Stream); - Jmsg(jcr, M_ERROR, 0, "%s", bdb->errmsg); - return 0; + Jmsg(jcr, M_FATAL, 0, "%s", mdb->errmsg); + return false; } split_path_and_file(jcr, bdb, ar->fname); diff --git a/bacula/src/filed/authenticate.c b/bacula/src/filed/authenticate.c index 00db82327b..f5753ef748 100644 --- a/bacula/src/filed/authenticate.c +++ b/bacula/src/filed/authenticate.c @@ -1,15 +1,7 @@ -/* - * Authenticate Director who is attempting to connect. - * - * Kern Sibbald, October 2000 - * - * Version $Id$ - * - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2006 Free Software Foundation Europe e.V. + Copyright (C) 2000-2007 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -33,6 +25,14 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * Authenticate Director who is attempting to connect. + * + * Kern Sibbald, October 2000 + * + * Version $Id$ + * + */ #include "bacula.h" #include "filed.h" @@ -234,12 +234,12 @@ int authenticate_storagedaemon(JCR *jcr) goto auth_fatal; } if (!auth_success) { - Dmsg1(50, "cram_respond failed for %s\n", sd->who()); + Dmsg1(3, "cram_respond failed for %s\n", sd->who()); } else { /* Now challenge him */ auth_success = cram_md5_challenge(sd, jcr->sd_auth_key, tls_local_need, compatible); if (!auth_success) { - Dmsg1(50, "cram_challenge failed for %s\n", sd->who()); + Dmsg1(3, "cram_challenge failed for %s\n", sd->who()); } } @@ -272,6 +272,9 @@ int authenticate_storagedaemon(JCR *jcr) goto auth_fatal; } } + if (debug_level == 3) { + Dmsg0(000, "FD->SD Auth OK\n"); + } auth_fatal: /* Destroy session key */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 58d9536375..2966567b2a 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,8 @@ General: 26Sep07 +kes Return insert attributes error message in db msg buffer to avoid + false error messages. kes Separate batch init error messages. kes Make SD code that contructs attribute insert check string lengths more carefully.