summaryrefslogtreecommitdiffstats
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-04-11 09:13:10 +0200
committerJeremy Allison <jra@samba.org>2014-04-23 22:33:08 +0200
commitdac9b3d73f94e86acb3770bf5ca728f107505b0b (patch)
tree90c10efcb1265dd3315e8c5337fd3aa9cdc376ff /source3/smbd
parent78543b9bce5f823f44963e76638b02d55d76633e (diff)
downloadsamba-dac9b3d73f94e86acb3770bf5ca728f107505b0b.tar.gz
samba-dac9b3d73f94e86acb3770bf5ca728f107505b0b.tar.xz
samba-dac9b3d73f94e86acb3770bf5ca728f107505b0b.zip
smbd: Always clean up the child's msg_ctx
This is a bit lazy programming, we could and possibly should do this in exit_server() in the child. But this way we make sure the cleanup works. If it only was executed for unclean exits, we might not detect failure of this code in the parent. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index df565cf0aea..5c764be9235 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -445,9 +445,14 @@ static void remove_child_pid(struct smbd_parent_context *parent,
{
struct smbd_child_pid *child;
struct server_id child_id;
+ NTSTATUS status;
child_id = pid_to_procid(pid);
+ status = messaging_dgm_cleanup(parent->msg_ctx, pid);
+ DEBUG(10, ("%s: messaging_dgm_cleanup returned %s\n",
+ __func__, nt_errstr(status)));
+
for (child = parent->children; child != NULL; child = child->next) {
if (child->pid == pid) {
struct smbd_child_pid *tmp = child;
@@ -465,8 +470,6 @@ static void remove_child_pid(struct smbd_parent_context *parent,
}
if (unclean_shutdown) {
- NTSTATUS status;
-
/* a child terminated uncleanly so tickle all
processes to see if they can grab any of the
pending locks
@@ -483,10 +486,6 @@ static void remove_child_pid(struct smbd_parent_context *parent,
parent);
DEBUG(1,("Scheduled cleanup of brl and lock database after unclean shutdown\n"));
}
-
- status = messaging_dgm_cleanup(parent->msg_ctx, pid);
- DEBUG(10, ("%s: messaging_dgm_cleanup returned %s\n",
- __func__, nt_errstr(status)));
}
if (!serverid_deregister(child_id)) {