1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

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>
This commit is contained in:
Ralph Boehme 2020-06-30 17:02:07 +02:00 committed by Andreas Schneider
parent 7082902d56
commit 5aeaa6959d

View File

@ -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 );