The Samba-Bugzilla – Attachment 10729 Details for
Bug 11100
Rotated log files are left open in smbd/winbindd child
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for master
0001-debug-Set-close-on-exec-for-the-main-log-file-FD.patch (text/plain), 2.08 KB, created by
Andrew Bartlett
on 2015-02-16 03:21:59 UTC
(
hide
)
Description:
patch for master
Filename:
MIME Type:
Creator:
Andrew Bartlett
Created:
2015-02-16 03:21:59 UTC
Size:
2.08 KB
patch
obsolete
>From be06a76ae3232b3dc887f26767479c071e6e0ecc Mon Sep 17 00:00:00 2001 >From: Andrew Bartlett <abartlet@samba.org> >Date: Mon, 16 Feb 2015 15:59:11 +1300 >Subject: [PATCH] debug: Set close-on-exec for the main log file FD > >This does not change the properties of dup2() of the fd as STDERR, however this is closed >before we start smbd or winbindd as child processes. > >This is needed otherwise the logfile remains open in the child process, and >logfile rotation can mean this old log remains on disk indefinatly. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11100 >Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> >Signed-off-by: Garming Sam <garming@catalyst.net.nz> >Signed-off-by: Andrew Bartlett <abartlet@samba.org> >--- > lib/util/debug.c | 3 +++ > lib/util/wscript_build | 2 +- > 2 files changed, 4 insertions(+), 1 deletion(-) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index a794c5b..80a1c25 100644 >--- a/lib/util/debug.c >+++ b/lib/util/debug.c >@@ -604,6 +604,7 @@ bool reopen_logs_internal(void) > log_overflow = false; > ret = false; > } else { >+ smb_set_close_on_exec(new_fd); > old_fd = state.fd; > state.fd = new_fd; > debug_close_fd(old_fd); >@@ -735,6 +736,7 @@ void check_log_size( void ) > */ > int fd = open( "/dev/console", O_WRONLY, 0); > if (fd != -1) { >+ smb_set_close_on_exec(fd); > state.fd = fd; > DEBUG(0,("check_log_size: open of debug file %s failed - using console.\n", > state.debugf )); >@@ -791,6 +793,7 @@ static int Debug1(const char *msg) > if(fd == -1) { > goto done; > } >+ smb_set_close_on_exec(fd); > state.fd = fd; > } > } >diff --git a/lib/util/wscript_build b/lib/util/wscript_build >index a1dec2a..3121e1f 100755 >--- a/lib/util/wscript_build >+++ b/lib/util/wscript_build >@@ -27,7 +27,7 @@ bld.SAMBA_SUBSYSTEM('close-low-fd', > > bld.SAMBA_LIBRARY('samba-debug', > source='debug.c', >- deps='replace time-basic close-low-fd talloc', >+ deps='replace time-basic close-low-fd talloc socket-blocking', > local_include=False, > private_library=True) > >-- >2.1.3 >
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 11100
: 10729 |
10766
|
10767