The Samba-Bugzilla – Attachment 17350 Details for
Bug 15076
logging dsdb audit to specific files does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.15 and 4.16
cmdline_s4-re-initialise-logging-4.16.patch (text/plain), 2.38 KB, created by
Douglas Bagnall
on 2022-06-14 23:27:00 UTC
(
hide
)
Description:
Patch for 4.15 and 4.16
Filename:
MIME Type:
Creator:
Douglas Bagnall
Created:
2022-06-14 23:27:00 UTC
Size:
2.38 KB
patch
obsolete
>From 6d6c15473513e39164f7df5408b9e803b7832245 Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Thu, 26 May 2022 15:46:08 +1200 >Subject: [PATCH] cmdline_s4: re-initialise logging once loadparm is ready > >The first time round we maybe didn't know which files we wanted to log to. >Suppose, for example, we had an smb.conf with > > log level = 1 dsdb_group_json_audit:5@/var/log/group_json.log > >we wouldn't see anything in "/var/log/group_json.log", while the level >5 dsdb_group_json_audit messages would go into the main log. > >Note that the named file would still be opened by winbindd and others >that use the s3 code, but would remain empty as they don't have anything >to say about dsdb_group_json_audit. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15076 > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >Reviewed-by: Andreas Schneider <asn@samba.org> >(cherry picked from commit 9537ac723cfdc43e718fdd08dc28883e7057a372) >--- > lib/cmdline/cmdline_s4.c | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > >diff --git a/lib/cmdline/cmdline_s4.c b/lib/cmdline/cmdline_s4.c >index 29e9f34bbe2..f8be4ed670c 100644 >--- a/lib/cmdline/cmdline_s4.c >+++ b/lib/cmdline/cmdline_s4.c >@@ -31,6 +31,8 @@ static bool _samba_cmdline_load_config_s4(void) > { > struct loadparm_context *lp_ctx = samba_cmdline_get_lp_ctx(); > const char *config_file = NULL; >+ const struct samba_cmdline_daemon_cfg *cmdline_daemon_cfg = \ >+ samba_cmdline_get_daemon_cfg(); > bool ok; > > /* Load smb conf */ >@@ -45,15 +47,11 @@ static bool _samba_cmdline_load_config_s4(void) > } > > switch (_config_type) { >- case SAMBA_CMDLINE_CONFIG_SERVER: { >- const struct samba_cmdline_daemon_cfg *cmdline_daemon_cfg = >- samba_cmdline_get_daemon_cfg(); >- >+ case SAMBA_CMDLINE_CONFIG_SERVER: > if (!cmdline_daemon_cfg->interactive) { > setup_logging(getprogname(), DEBUG_FILE); > } > break; >- } > default: > break; > } >@@ -70,6 +68,20 @@ static bool _samba_cmdline_load_config_s4(void) > } > } > >+ switch (_config_type) { >+ case SAMBA_CMDLINE_CONFIG_SERVER: >+ /* >+ * We need to setup_logging *again* to ensure multi-file >+ * logging is set up as specified in smb.conf. >+ */ >+ if (!cmdline_daemon_cfg->interactive) { >+ setup_logging(getprogname(), DEBUG_FILE); >+ } >+ break; >+ default: >+ break; >+ } >+ > return true; > } > >-- >2.25.1 >
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
Flags:
abartlet
:
review+
Actions:
View
Attachments on
bug 15076
: 17350