The branch, master has been updated
       via  44a7040 s3: cldap: cldap_multi_netlogon_send() fails with one bad 
IPv6 address.
       via  e84521d lib: Fix a pthreadpool race condition
       via  30f084d ctdb: Add a required include
       via  6c95148 ctdb: Fix format errors for time_t!=long
      from  c89fa0d s3/vfs: gpfs: adapt vfs_gpfs_is_offline() to changes from 
3031815f982e365be50148564d47d7d5afab46e0

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


- Log -----------------------------------------------------------------
commit 44a7040500d74551b48eba04f5d0bedb1ec35ba6
Author: Jeremy Allison <j...@samba.org>
Date:   Mon Oct 17 10:07:23 2016 -0700

    s3: cldap: cldap_multi_netlogon_send() fails with one bad IPv6 address.
    
    Analysis by: Rebecca Gellman <rebe...@starfleet-net.co.uk>
    
    Ignore cldap_socket_init() failure when sending
    multiple cldap netlogon requests. Allow cldap_netlogon_send()
    to catch the bad address and correctly return through a
    tevent subreq.
    
    Make sure cldap_search_send() copes with cldap parameter == NULL.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12381
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    
    Autobuild-User(master): Ralph Böhme <s...@samba.org>
    Autobuild-Date(master): Tue Oct 18 02:16:20 CEST 2016 on sn-devel-144

commit e84521dc44585fbde8b239bed2dcfaa1423d2796
Author: Volker Lendecke <v...@samba.org>
Date:   Mon Oct 17 17:09:01 2016 +0200

    lib: Fix a pthreadpool race condition
    
    Yes, there is one.... I've seen two flaky builds on sn-devel with
    pthreadpool after the coverity checks went in. They were in the
    
                ret = pthread_mutex_unlock(&pool->mutex);
                assert(ret == 0);
    
    in pthreadpool_parent() and pthreadpool_child(). No idea what that was,
    I could not really reproduce that. A build attempt on FreeBSD also gave
    an erratic error, this time it was an EINVAL in
    
                ret = pthread_mutex_lock(&pool->mutex);
                assert(ret == 0);
    
    pthreadpool_parent(). EINVAL means that the mutex is not a proper
    mutex. What happened: Someone (a detached thread) does the
    pthreadpool_free behind our back, while we are in pthreadpool_parent,
    preparing the fork. Unfortunately the mutex was already destroyed before
    we came to lock it.
    
    The fix is simple: Remove the obsolete struct pthreadpool from the
    linked list before the mutex is destroyed.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit 30f084dfd072936d1226479f22d4065dec084136
Author: Volker Lendecke <v...@samba.org>
Date:   Mon Oct 17 16:42:37 2016 +0200

    ctdb: Add a required include
    
    exit(3) is defined in stdlib.h
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit 6c95148f859c4608b416c47783178fbca0005370
Author: Volker Lendecke <v...@samba.org>
Date:   Mon Oct 17 11:27:17 2016 +0200

    ctdb: Fix format errors for time_t!=long
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

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

Summary of changes:
 ctdb/server/ctdb_daemon.c             |  4 ++--
 ctdb/tools/ctdb.c                     |  4 ++--
 ctdb/utils/smnotify/smnotify.c        |  1 +
 libcli/cldap/cldap.c                  |  5 +++++
 source3/lib/pthreadpool/pthreadpool.c | 16 ++++++++--------
 source3/libads/cldap.c                | 17 +++++++++++++++--
 6 files changed, 33 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index fc1ce27..0d24e21 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -1134,7 +1134,7 @@ static void ctdb_tevent_trace(enum tevent_trace_point tp,
                if (diff.tv_sec > 3) {
                        DEBUG(DEBUG_ERR,
                              ("Handling event took %ld seconds!\n",
-                              diff.tv_sec));
+                              (long)diff.tv_sec));
                }
                tevent_before_wait_ts = now;
                break;
@@ -1144,7 +1144,7 @@ static void ctdb_tevent_trace(enum tevent_trace_point tp,
                if (diff.tv_sec > 3) {
                        DEBUG(DEBUG_ERR,
                              ("No event for %ld seconds!\n",
-                              diff.tv_sec));
+                              (long)diff.tv_sec));
                }
                tevent_after_wait_ts = now;
                break;
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index d2f78b8..2d61e22 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -4630,9 +4630,9 @@ static void print_scriptstatus_one(struct 
ctdb_script_list *slist,
                               slist->script[i].name, options.sep,
                               slist->script[i].status, options.sep,
                               status, options.sep,
-                              slist->script[i].start.tv_sec,
+                              (unsigned long)slist->script[i].start.tv_sec,
                               slist->script[i].start.tv_usec, options.sep,
-                              slist->script[i].finished.tv_sec,
+                              (unsigned long)slist->script[i].finished.tv_sec,
                               slist->script[i].finished.tv_usec, options.sep,
                               slist->script[i].output, options.sep);
                        continue;
diff --git a/ctdb/utils/smnotify/smnotify.c b/ctdb/utils/smnotify/smnotify.c
index 0cd61c7..43ca7f3 100644
--- a/ctdb/utils/smnotify/smnotify.c
+++ b/ctdb/utils/smnotify/smnotify.c
@@ -23,6 +23,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <stdlib.h>
 #include "smnotify.h"
 #include "popt.h"
 
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index c5977cc..87f82b9 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -585,6 +585,11 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx,
 
        talloc_set_destructor(state, cldap_search_state_destructor);
 
+       if (state->caller.cldap == NULL) {
+               tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+               goto post;
+       }
+
        if (io->in.dest_address) {
                if (cldap->connected) {
                        tevent_req_nterror(req, NT_STATUS_PIPE_CONNECTED);
diff --git a/source3/lib/pthreadpool/pthreadpool.c 
b/source3/lib/pthreadpool/pthreadpool.c
index f34e219..eaddd44 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -234,6 +234,14 @@ static int pthreadpool_free(struct pthreadpool *pool)
 {
        int ret, ret1;
 
+       ret = pthread_mutex_lock(&pthreadpools_mutex);
+       if (ret != 0) {
+               return ret;
+       }
+       DLIST_REMOVE(pthreadpools, pool);
+       ret = pthread_mutex_unlock(&pthreadpools_mutex);
+       assert(ret == 0);
+
        ret = pthread_mutex_destroy(&pool->mutex);
        ret1 = pthread_cond_destroy(&pool->condvar);
 
@@ -244,14 +252,6 @@ static int pthreadpool_free(struct pthreadpool *pool)
                return ret1;
        }
 
-       ret = pthread_mutex_lock(&pthreadpools_mutex);
-       if (ret != 0) {
-               return ret;
-       }
-       DLIST_REMOVE(pthreadpools, pool);
-       ret = pthread_mutex_unlock(&pthreadpools_mutex);
-       assert(ret == 0);
-
        free(pool->jobs);
        free(pool);
 
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c
index bd77943..586a04a 100644
--- a/source3/libads/cldap.c
+++ b/source3/libads/cldap.c
@@ -117,8 +117,21 @@ struct tevent_req *cldap_multi_netlogon_send(
                                           NULL, /* local_addr */
                                           state->servers[i],
                                           &state->cldap[i]);
-               if (tevent_req_nterror(req, status)) {
-                       return tevent_req_post(req, ev);
+               if (!NT_STATUS_IS_OK(status)) {
+                       /*
+                        * Don't error out all sends just
+                        * because one cldap_socket_init() failed.
+                        * Log it here, and the cldap_netlogon_send()
+                        * will catch it (with in.dest_address == NULL)
+                        * and correctly error out in
+                        * cldap_multi_netlogon_done(). This still allows
+                        * the other requests to be concurrently sent.
+                        */
+                       DBG_NOTICE("cldap_socket_init failed for %s "
+                               " error %s\n",
+                               tsocket_address_string(state->servers[i],
+                                       req),
+                               nt_errstr(status));
                }
 
                state->ios[i].in.dest_address   = NULL;


-- 
Samba Shared Repository

Reply via email to