Bug 14852 - child winbindd logs to log.winbindd instead of log.wb-<DOMAIN>
Summary: child winbindd logs to log.winbindd instead of log.wb-<DOMAIN>
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-01 15:52 UTC by Pavel Fiipenský
Modified: 2021-10-27 13:26 UTC (History)
3 users (show)

See Also:


Attachments
patch for v4-15 (3.84 KB, patch)
2021-10-08 19:48 UTC, Pavel Fiipenský
no flags Details
new patch for 4.15 (9.14 KB, patch)
2021-10-20 13:08 UTC, Pavel Fiipenský
asn: review+
pfilipen: review? (jra)
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Fiipenský 2021-10-01 15:52:14 UTC
I have spotted in the latest samba build that winbindd children log to log.winbindd.

This was introduced via commit
cf4a868 2021-09-17 10:22 +0200 Volker Lendecke o debug: Remove "override_logfile"

winbindd_reinit_after_fork() no longer takes the if branch:

-       if (!override_logfile && logfilename) {
+       if (is_default_dyn_LOGFILEBASE() && logfilename) {
Comment 1 Pavel Fiipenský 2021-10-08 11:28:41 UTC
Patch will follow.
Comment 2 Jeremy Allison 2021-10-08 17:45:55 UTC
Thanks for taking care of this Pavel, I'll review once your patch is ready.
Comment 3 Pavel Fiipenský 2021-10-08 19:48:55 UTC
Created attachment 16843 [details]
patch for v4-15
Comment 4 Pavel Fiipenský 2021-10-08 19:50:18 UTC
Handling of logfile name for main and child winbindd must ensure:

1) Log directory is selected in this order:
  * -l option of winbindd
  * "log file" parameter in smb.conf
  * compile time value '/usr/local/samba/var'

2) Log filename pattern
  * parent process uses log.winbindd
  * child uses log.wb-<name>

3) Log reopen works for both parent and child (i.e. log filename is not changed)
  * kill -HUP <pid>
  * smbcontrol <pid> reload-config

This fix removes 3 calls of is_default_dyn_LOGFILEBASE() to make sure that:
  - 1st removal: child uses log.wb-<name> after the fork
  - 2nd removal: child after HUP signal, does not switch to log.winbindd
  - 3rd removal: child after smbcontrol reload-config, does not switch to
    log.winbindd
Comment 5 Samba QA Contact 2021-10-12 09:31:04 UTC
This bug was referenced in samba master:

b92589c31f0eb3eaf2b3b1867e10b759f6a2edda
12d04d9a9288a9358d5f5aebaec126cc610952b1
Comment 6 Jeremy Allison 2021-10-14 23:50:15 UTC
Comment on attachment 16843 [details]
patch for v4-15

Pavel, this doesn't apply to v4-15-test. Can you check this applies to a current 4.15 tree ?
Comment 7 Pavel Fiipenský 2021-10-20 13:08:17 UTC
Created attachment 16860 [details]
new patch for 4.15

This patch contains also one additional commit cf4a868, it is needed
Comment 8 Ralph Böhme 2021-10-20 14:25:43 UTC
Reassigning to Jule for inclusion in 4.15.
Comment 9 Samba QA Contact 2021-10-22 08:40:04 UTC
This bug was referenced in samba v4-15-test:

b8c8c2017dbcfe8debf6fee5d131ff36a0e79a39
b299897ab58a22d50c296cc446725ad7aa1b57d3
Comment 10 Jule Anger 2021-10-22 09:08:43 UTC
Closing out bug report.

Thanks!
Comment 11 Samba QA Contact 2021-10-27 13:26:03 UTC
This bug was referenced in samba v4-15-stable (Release samba-4.15.1):

b8c8c2017dbcfe8debf6fee5d131ff36a0e79a39
b299897ab58a22d50c296cc446725ad7aa1b57d3