The Samba-Bugzilla – Attachment 16101 Details for
Bug 14426
log level for debug classes is ignored
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patch for master
debug (text/plain), 2.75 KB, created by
Ralph Böhme
on 2020-06-30 19:36:00 UTC
(
hide
)
Description:
WIP patch for master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2020-06-30 19:36:00 UTC
Size:
2.75 KB
patch
obsolete
>From d86d2e299cc5f5cb16601f5fcb9bbd9047b1f3a7 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Tue, 30 Jun 2020 17:02:07 +0200 >Subject: [PATCH 1/2] 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> >--- > lib/util/debug.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index 4b9a79e0b6f..ebd12bfb0a1 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 ); > >-- >2.26.2 > > >From f3ed52b5fc848a5be09bafaddc296fd1704985c9 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Tue, 30 Jun 2020 17:03:05 +0200 >Subject: [PATCH 2/2] lib/debug: set the correct default backend loglevel to > MAX_DEBUG_LEVEL > >The backend loglevel globally restricts logging of a particular backend. If this >value is smaller then any explicitly configured logging class, logging for this >class is skipped. > >Eg, given the following logging config in smb.conf: > > log level = 1 auth_json_audit:3@/var/log/samba/samba_auth_audit.log > >the default class loglevel of 1 (dbgc_config[DBGC_ALL].loglevel) will be >assigned to the backend loglevel. > >So even though the logging class auth_json_audit is configured at level 3, this >doesn't become effective as the file backend drops all log messages with a level >below 1. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14426 > >Signed-off-by: Ralph Boehme <slow@samba.org> >--- > lib/util/debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index ebd12bfb0a1..08ffee35a1f 100644 >--- a/lib/util/debug.c >+++ b/lib/util/debug.c >@@ -1146,7 +1146,7 @@ bool reopen_logs_internal(void) > b = debug_find_backend("file"); > assert(b != NULL); > >- b->log_level = dbgc_config[DBGC_ALL].loglevel; >+ b->log_level = MAX_DEBUG_LEVEL; > break; > } > >-- >2.26.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14426
:
16101
|
16111