[SCM] Samba Shared Repository - branch v3-0-test updated -
release-3-0-29-16-gd740f5c
Jeremy Allison
jra at samba.org
Sat May 31 00:25:09 GMT 2008
The branch, v3-0-test has been updated
via d740f5cc0677ae285dcae1729a194d775a6560ff (commit)
from 94148384a5d6890c0534c3baebee1a1c61a7705b (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test
- Log -----------------------------------------------------------------
commit d740f5cc0677ae285dcae1729a194d775a6560ff
Author: Jeremy Allison <jra at samba.org>
Date: Fri May 30 17:23:59 2008 -0700
Fix bug #5504. winbindd children and parent were handing SIGTERM in the same way - deleting the socket !
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/nsswitch/winbindd.c | 27 +++++++++++++++++----------
source/nsswitch/winbindd_dual.c | 2 +-
2 files changed, 18 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c
index 636d635..c79bb46 100644
--- a/source/nsswitch/winbindd.c
+++ b/source/nsswitch/winbindd.c
@@ -117,14 +117,21 @@ static void flush_caches(void)
/* Handle the signal by unlinking socket and exiting */
-static void terminate(void)
+static void terminate(bool in_parent)
{
- pstring path;
-
- /* Remove socket file */
- pstr_sprintf(path, "%s/%s",
- WINBINDD_SOCKET_DIR, WINBINDD_SOCKET_NAME);
- unlink(path);
+ if (in_parent) {
+ /* When parent goes away we should
+ * remove the socket file. Not so
+ * when children terminate.
+ */
+
+ pstring path;
+
+ /* Remove socket file */
+ pstr_sprintf(path, "%s/%s",
+ WINBINDD_SOCKET_DIR, WINBINDD_SOCKET_NAME);
+ unlink(path);
+ }
idmap_close();
@@ -731,10 +738,10 @@ void winbind_check_sighup(void)
}
/* check if TERM has been received */
-void winbind_check_sigterm(void)
+void winbind_check_sigterm(bool in_parent)
{
if (do_sigterm)
- terminate();
+ terminate(in_parent);
}
/* Process incoming clients on listen_sock. We use a tricky non-blocking,
@@ -901,7 +908,7 @@ static void process_loop(void)
/* Check signal handling things */
- winbind_check_sigterm();
+ winbind_check_sigterm(true);
winbind_check_sighup();
if (do_sigusr2) {
diff --git a/source/nsswitch/winbindd_dual.c b/source/nsswitch/winbindd_dual.c
index 7176a25..7b79734 100644
--- a/source/nsswitch/winbindd_dual.c
+++ b/source/nsswitch/winbindd_dual.c
@@ -1005,7 +1005,7 @@ static BOOL fork_domain_child(struct winbindd_child *child)
main_loop_TALLOC_FREE();
/* check for signals */
- winbind_check_sigterm();
+ winbind_check_sigterm(false);
winbind_check_sighup();
run_events(winbind_event_context(), 0, NULL, NULL);
--
Samba Shared Repository
More information about the samba-cvs
mailing list