diff options
author | Tim Beale <timbeale@catalyst.net.nz> | 2019-07-30 16:40:55 +1200 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2019-08-20 03:40:28 +0000 |
commit | a2b0fc7c00360f37ed6819f21380294b70d4a195 (patch) | |
tree | ee3bf8fea460ddbfb9a7f901e5fe5196f32fa808 | |
parent | 6dcf00ba0a470ba25aabae06b409ec95404c246f (diff) | |
download | samba-a2b0fc7c00360f37ed6819f21380294b70d4a195.tar.gz |
ldb: Always log when the database pack format changes
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>
-rw-r--r-- | lib/ldb/include/ldb.h | 3 | ||||
-rw-r--r-- | lib/ldb/ldb_key_value/ldb_kv_index.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h index f06d5e95528..3cba0f4d543 100644 --- a/lib/ldb/include/ldb.h +++ b/lib/ldb/include/ldb.h @@ -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 diff --git a/lib/ldb/ldb_key_value/ldb_kv_index.c b/lib/ldb/ldb_key_value/ldb_kv_index.c index ef275b28013..5de316579d7 100644 --- a/lib/ldb/ldb_key_value/ldb_kv_index.c +++ b/lib/ldb/ldb_key_value/ldb_kv_index.c @@ -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; |