diff options
author | Ralph Boehme <slow@samba.org> | 2020-06-30 17:02:07 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-07-09 09:56:20 +0000 |
commit | d77eb1c1670ec40a4c4f757ba8cc8e13c3a976bb (patch) | |
tree | 9e9a4e4003b1132fd7c21b173d2944a5d063ad5c | |
parent | c557da03cfe605bd09d9c63b705944068eaa6129 (diff) | |
download | samba-d77eb1c1670ec40a4c4f757ba8cc8e13c3a976bb.tar.gz |
lib/debug: assert file backend
The debug file backend is a built-in default, if it's missing we're totally
screwed.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14426
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 5aeaa6959da326095e98f0369b6d91dc5667415e)
-rw-r--r-- | lib/util/debug.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c index 6b5d5f9bd0c..4bc38e22cee 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -30,6 +30,7 @@ #include "util_strlist.h" /* LIST_SEP */ #include "blocking.h" #include "debug.h" +#include <assert.h> /* define what facility to use for syslog */ #ifndef SYSLOG_FACILITY @@ -1113,6 +1114,7 @@ static bool reopen_one_log(int *fd, const char *logfile) */ bool reopen_logs_internal(void) { + struct debug_backend *b = NULL; mode_t oldumask; int new_fd = 0; size_t i; @@ -1140,15 +1142,13 @@ bool reopen_logs_internal(void) dbgc_config[DBGC_ALL].fd = 2; return true; - case DEBUG_FILE: { - struct debug_backend *b = debug_find_backend("file"); + case DEBUG_FILE: + b = debug_find_backend("file"); + assert(b != NULL); - if (b != NULL) { - b->log_level = dbgc_config[DBGC_ALL].loglevel; - } + b->log_level = dbgc_config[DBGC_ALL].loglevel; break; } - } oldumask = umask( 022 ); |