The branch, master has been updated
       via  1e8ad19 winbindd: Initialize the domain groups member
       via  2abf47c winbindd: Free is_parent before we terminate
       via  a5cd134 winbindd: Free memory before we exit the connect child
      from  b4384b7 winbind: Improve child selection

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


- Log -----------------------------------------------------------------
commit 1e8ad19653f11adbcffecde3a5762b28c5e06c8d
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Feb 9 16:19:53 2018 +0100

    winbindd: Initialize the domain groups member
    
    ==9405== 4 errors in context 1 of 493:
    ==9405== Conditional jump or move depends on uninitialised value(s)
    ==9405==    at 0x7507F71: vfprintf (in /lib64/libc-2.12.so)
    ==9405==    by 0x75C515B: __vasprintf_chk (in /lib64/libc-2.12.so)
    ==9405==    by 0x2A8728: dbgtext (stdio2.h:199)
    ==9405==    by 0x22DCBB: winbindd_list_groups_done 
(winbindd_list_groups.c:127)
    ==9405==    by 0x6C7F568: _tevent_req_error (tevent_req.c:167)
    ==9405==    by 0x6C7F568: _tevent_req_error (tevent_req.c:167)
    ==9405==    by 0x6C7F568: _tevent_req_error (tevent_req.c:167)
    ==9405==    by 0x3CDAE8: dcerpc_binding_handle_call_done 
(binding_handle.c:445)
    ==9405==    by 0x6C7F568: _tevent_req_error (tevent_req.c:167)
    ==9405==    by 0x6C7F568: _tevent_req_error (tevent_req.c:167)
    ==9405==    by 0x202701: wbint_bh_raw_call_done (winbindd_dual_ndr.c:139)
    ==9405==    by 0x6C82C60: tevent_common_loop_timer_delay 
(tevent_timed.c:341)
    ==9405==    by 0x6C83CA1: epoll_event_loop_once (tevent_epoll.c:911)
    ==9405==    by 0x6C822D5: std_event_loop_once (tevent_standard.c:114)
    ==9405==    by 0x6C7DC3C: _tevent_loop_once (tevent.c:533)
    ==9405==    by 0x1D8A03: main (winbindd.c:1490)
    ==9405==  Uninitialised value was created by a heap allocation
    ==9405==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
    ==9405==    by 0x6A71DCA: _talloc_array (in /usr/lib64/libtalloc.so.2.1.5)
    ==9405==    by 0x22D959: winbindd_list_groups_send 
(winbindd_list_groups.c:69)
    ==9405==    by 0x1D76BC: winbind_client_request_read (winbindd.c:647)
    ==9405==    by 0x23AF2A: wb_req_read_done (wb_reqtrans.c:126)
    ==9405==    by 0x6C83EA5: epoll_event_loop_once (tevent_epoll.c:728)
    ==9405==    by 0x6C822D5: std_event_loop_once (tevent_standard.c:114)
    ==9405==    by 0x6C7DC3C: _tevent_loop_once (tevent.c:533)
    ==9405==    by 0x1D8A03: main (winbindd.c:1490)
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Tue Feb 13 00:25:27 CET 2018 on sn-devel-144

commit 2abf47cfb3153108e3b153fee571ab187f9eb755
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Feb 9 15:33:39 2018 +0100

    winbindd: Free is_parent before we terminate
    
    This makes valgrind happy.
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit a5cd134ed7634328c9d0b64a45a59c04530c7249
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Feb 9 15:27:42 2018 +0100

    winbindd: Free memory before we exit the connect child
    
    This will make valgrind happy.
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

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

Summary of changes:
 source3/winbindd/winbindd.c             | 9 ++++++---
 source3/winbindd/winbindd_cm.c          | 5 ++++-
 source3/winbindd/winbindd_list_groups.c | 7 ++++++-
 3 files changed, 16 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 0a8d146..6e3df1f 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -233,11 +233,14 @@ static void winbindd_sig_term_handler(struct 
tevent_context *ev,
                                      void *siginfo,
                                      void *private_data)
 {
-       bool *is_parent = talloc_get_type_abort(private_data, bool);
+       bool *p = talloc_get_type_abort(private_data, bool);
+       bool is_parent = *p;
+
+       TALLOC_FREE(p);
 
        DEBUG(0,("Got sig[%d] terminate (is_parent=%d)\n",
-                signum, (int)*is_parent));
-       terminate(*is_parent);
+                signum, is_parent));
+       terminate(is_parent);
 }
 
 /*
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 54416e0..4229647 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -199,6 +199,7 @@ static bool fork_child_dc_connect(struct winbindd_domain 
*domain)
        pid_t parent_pid = getpid();
        char *lfile = NULL;
        NTSTATUS status;
+       bool ok;
 
        if (domain->dc_probe_pid != (pid_t)-1) {
                /*
@@ -269,7 +270,9 @@ static bool fork_child_dc_connect(struct winbindd_domain 
*domain)
                _exit(1);
        }
 
-       if ((!get_dcs(mem_ctx, domain, &dcs, &num_dcs, 0)) || (num_dcs == 0)) {
+       ok = get_dcs(mem_ctx, domain, &dcs, &num_dcs, 0);
+       TALLOC_FREE(mem_ctx);
+       if (!ok || (num_dcs == 0)) {
                /* Still offline ? Can't find DC's. */
                messaging_send_buf(server_messaging_context(),
                                   pid_to_procid(parent_pid),
diff --git a/source3/winbindd/winbindd_list_groups.c 
b/source3/winbindd/winbindd_list_groups.c
index 3b5c9dd..f593ba2 100644
--- a/source3/winbindd/winbindd_list_groups.c
+++ b/source3/winbindd/winbindd_list_groups.c
@@ -74,6 +74,8 @@ struct tevent_req *winbindd_list_groups_send(TALLOC_CTX 
*mem_ctx,
        }
 
        if (request->domain_name[0] != '\0') {
+               ZERO_STRUCT(state->domains[0].groups);
+
                state->domains[0].domain = find_domain_from_name_noinit(
                        request->domain_name);
                if (state->domains[0].domain == NULL) {
@@ -83,7 +85,10 @@ struct tevent_req *winbindd_list_groups_send(TALLOC_CTX 
*mem_ctx,
        } else {
                i = 0;
                for (domain = domain_list(); domain; domain = domain->next) {
-                       state->domains[i++].domain = domain;
+                       ZERO_STRUCT(state->domains[i].groups);
+
+                       state->domains[i].domain = domain;
+                       i++;
                }
        }
 


-- 
Samba Shared Repository

Reply via email to