The branch, master has been updated
       via  ed058f4 s3: Fix a winbind race leading to 100% CPU
       via  b72944f s3: Fix two int/enum mixups
      from  e8aed94 s4-drsuapi Allow DsAddEntry of normal objects

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ed058f4dc3e059967f3c0538bc220866e9c63588
Author: Volker Lendecke <[email protected]>
Date:   Fri Aug 26 16:54:18 2011 +0200

    s3: Fix a winbind race leading to 100% CPU
    
    This fixes a race condition that leads to the winbindd_children list 
becoming
    corrupted. It happens when on a busy winbind SIGCHLD is a bit late.
    
    Imagine a winbind with multiple requests in the queue for a single child. 
Child
    dies, and before the SIGCHLD handler is called we find the socket to be 
dead.
    wb_child_request_done is called, receiving an error from 
wb_simple_trans_recv.
    It closes the socket. Then immediately the wb_child_request_trigger will do
    another fork_domain_child before the signal handler is called. This means 
that
    we do another fork_domain_child, we have child->sock==-1 at this point.
    fork_domain_child will do a DLIST_ADD(winbindd_children, child) a second 
time
    where the child is already part of that list. This corrupts the list. Then 
the
    signal handler kicks in, spinning in
    
    for (child = winbindd_children; child != NULL; child = child->next) {
    
    forever. Not good. This patch makes sure that both conditions (sock==-1 and 
not
    part of the list) for a winbindd_child struct match up.
    
    Autobuild-User: Volker Lendecke <[email protected]>
    Autobuild-Date: Fri Aug 26 18:51:24 CEST 2011 on sn-devel-104

commit b72944fea743ec187750239568ba904c7fad653f
Author: Volker Lendecke <[email protected]>
Date:   Fri Aug 26 16:35:29 2011 +0200

    s3: Fix two int/enum mixups

-----------------------------------------------------------------------

Summary of changes:
 source3/winbindd/winbindd_dual.c |    5 +++--
 source3/winbindd/winbindd_samr.c |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 8851b8a..036ad27 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -43,6 +43,8 @@
 extern bool override_logfile;
 extern struct winbindd_methods cache_methods;
 
+static struct winbindd_child *winbindd_children = NULL;
+
 /* Read some data from a client connection */
 
 static NTSTATUS child_read_request(struct winbindd_cli_state *state)
@@ -171,6 +173,7 @@ static void wb_child_request_done(struct tevent_req *subreq)
                 */
                close(state->child->sock);
                state->child->sock = -1;
+               DLIST_REMOVE(winbindd_children, state->child);
                tevent_req_error(req, err);
                return;
        }
@@ -489,8 +492,6 @@ void setup_child(struct winbindd_domain *domain, struct 
winbindd_child *child,
        SMB_ASSERT(child->binding_handle != NULL);
 }
 
-static struct winbindd_child *winbindd_children = NULL;
-
 void winbind_child_died(pid_t pid)
 {
        struct winbindd_child *child;
diff --git a/source3/winbindd/winbindd_samr.c b/source3/winbindd/winbindd_samr.c
index 582e2a6..c03f593 100644
--- a/source3/winbindd/winbindd_samr.c
+++ b/source3/winbindd/winbindd_samr.c
@@ -849,7 +849,7 @@ static NTSTATUS sam_lockout_policy(struct winbindd_domain 
*domain,
        status = dcerpc_samr_QueryDomainInfo(b,
                                             mem_ctx,
                                             &dom_pol,
-                                            12,
+                                            DomainLockoutInformation,
                                             &info,
                                             &result);
        if (!NT_STATUS_IS_OK(status)) {
@@ -901,7 +901,7 @@ static NTSTATUS sam_password_policy(struct winbindd_domain 
*domain,
        status = dcerpc_samr_QueryDomainInfo(b,
                                             mem_ctx,
                                             &dom_pol,
-                                            1,
+                                            DomainPasswordInformation,
                                             &info,
                                             &result);
        if (!NT_STATUS_IS_OK(status)) {


-- 
Samba Shared Repository

Reply via email to