]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb: Always log when the database pack format changes
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 30 Jul 2019 04:40:55 +0000 (16:40 +1200)
committerGarming Sam <garming@samba.org>
Tue, 20 Aug 2019 03:40:28 +0000 (03:40 +0000)
LDB_DEBUG_WARNING gets logged by Samba as level 2, whereas the default
log level for Samba is 0. It's not really fair to the user to change the
format of their database on disk and potentially not tell them.

This patch adds a log with level zero (using a alias define, as this
technically isn't a fatal problem).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/include/ldb.h
lib/ldb/ldb_key_value/ldb_kv_index.c

index f06d5e9552803f9b88265f9f42a4775d14301d03..3cba0f4d5439745c35683d7e7600ff1a615866bb 100644 (file)
@@ -220,6 +220,9 @@ struct tevent_context;
 enum ldb_debug_level {LDB_DEBUG_FATAL, LDB_DEBUG_ERROR,
                      LDB_DEBUG_WARNING, LDB_DEBUG_TRACE};
 
+/* alias for something that's not a fatal error but we really want to log */
+#define LDB_DEBUG_ALWAYS_LOG  LDB_DEBUG_FATAL
+
 /**
   the user can optionally supply a debug function. The function
   is based on the vfprintf() style of interface, but with the addition
index ef275b2801331c4b05ad00ea533e70c4199f79f9..5de316579d7efd2b6658a8cb6d2b984de2693e9a 100644 (file)
@@ -3571,7 +3571,7 @@ static int re_pack(struct ldb_kv_private *ldb_kv,
         * want to spam the log.
         */
        if ((!ctx->normal_record_seen) && (!ldb_dn_is_special(msg->dn))) {
-               ldb_debug(ldb, LDB_DEBUG_WARNING,
+               ldb_debug(ldb, LDB_DEBUG_ALWAYS_LOG,
                          "Repacking database with format %#010x",
                          ldb_kv->pack_format_version);
                ctx->normal_record_seen = true;