[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Apr 24 20:27:02 UTC 2018


The branch, master has been updated
       via  d7cfb12 lib: #include "util_event.h" only where needed
       via  a37d9a4 tevent: Fix callers of tevent_req_set_endtime
       via  4fa8e56 torture3: Fix CID 1435119 Error handling issues (CHECKED_RETURN)
       via  a4d2eed s3:util: remove reinit_after_fork_pipe_handler before sending SIGTERM
      from  ffeb2ac winbind: Speed up wbinfo -p

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


- Log -----------------------------------------------------------------
commit d7cfb12bf3a29f31cd158246578ffbbf793d5425
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 24 14:19:48 2018 +0200

    lib: #include "util_event.h" only where needed
    
    One dependency of includes.h less
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Apr 24 22:26:22 CEST 2018 on sn-devel-144

commit a37d9a45d1ff1b5d311d190a8aac49bc2b2c7a9f
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Apr 23 15:36:28 2018 +0200

    tevent: Fix callers of tevent_req_set_endtime
    
    tevent_req_set_endtime internally already calls tevent_req_nomem and thus sets
    the error status correctly.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4fa8e5671584025d9553cac00210aca7ef62695a
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 24 10:37:26 2018 +0200

    torture3: Fix CID 1435119 Error handling issues (CHECKED_RETURN)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit a4d2eedafe333395d2fc1ce90fee5d63b11c6036
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 22 12:32:15 2018 +0100

    s3:util: remove reinit_after_fork_pipe_handler before sending SIGTERM
    
    We should not keep the tevent_fd active when we sending us a SIGTERM,
    this is not a real problem, but due to a different bug I triggered
    a 100% cpu loop. I think it's safer to idle in that case instead
    of waisting a lot of energy.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/tevent/tevent.h                 | 3 ++-
 libcli/cldap/cldap.c                | 1 -
 libcli/dns/dns.c                    | 1 -
 source3/include/includes.h          | 1 -
 source3/include/util_event.h        | 4 ++++
 source3/lib/g_lock.c                | 2 --
 source3/lib/util.c                  | 1 +
 source3/lib/util_event.c            | 1 +
 source3/lib/util_sock.c             | 1 -
 source3/libsmb/namequery.c          | 4 ----
 source3/printing/queue_process.c    | 1 +
 source3/smbd/process.c              | 1 +
 source3/torture/bench_pthreadpool.c | 8 ++++++--
 source4/libcli/smb2/session.c       | 1 -
 14 files changed, 16 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 7bb9c61..3ccac6a 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -1026,7 +1026,8 @@ struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
 #endif
 
 /**
- * @brief Set a timeout for an async request.
+ * @brief Set a timeout for an async request. On failure, "req" is already
+ *        set to state TEVENT_REQ_NO_MEMORY.
  *
  * @param[in]  req      The request to set the timeout for.
  *
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index 242a117..daba37a 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -663,7 +663,6 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx,
 	}
 
 	if (!tevent_req_set_endtime(req, state->caller.ev, end)) {
-		tevent_req_oom(req);
 		goto post;
 	}
 
diff --git a/libcli/dns/dns.c b/libcli/dns/dns.c
index c30de2d..1321b1d 100644
--- a/libcli/dns/dns.c
+++ b/libcli/dns/dns.c
@@ -97,7 +97,6 @@ static struct tevent_req *dns_udp_request_send(TALLOC_CTX *mem_ctx,
 
 	if (!tevent_req_set_endtime(req, ev,
 				timeval_current_ofs(DNS_REQUEST_TIMEOUT, 0))) {
-		tevent_req_oom(req);
 		return tevent_req_post(req, ev);
 	}
 
diff --git a/source3/include/includes.h b/source3/include/includes.h
index d822c3f..9c47c34 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -260,7 +260,6 @@ typedef char fstring[FSTRING_LEN];
 
 #include <talloc.h>
 #include <tevent.h>
-#include "util_event.h"
 
 #include "../lib/util/data_blob.h"
 #include "../lib/util/time.h"
diff --git a/source3/include/util_event.h b/source3/include/util_event.h
index f29bb0a..d19678e 100644
--- a/source3/include/util_event.h
+++ b/source3/include/util_event.h
@@ -19,6 +19,10 @@
 */
 
 /* The following definitions come from lib/util_event.c  */
+
+#include "replace.h"
+#include <tevent.h>
+
 struct idle_event;
 
 struct idle_event *event_add_idle(struct tevent_context *event_ctx,
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 9ce0e06..bffbd6b 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -387,7 +387,6 @@ struct tevent_req *g_lock_lock_send(TALLOC_CTX *mem_ctx,
 	if (!tevent_req_set_endtime(
 		    fn_state.watch_req, state->ev,
 		    timeval_current_ofs(5 + sys_random() % 5, 0))) {
-		tevent_req_oom(req);
 		return tevent_req_post(req, ev);
 	}
 	tevent_req_set_callback(fn_state.watch_req, g_lock_lock_retry, req);
@@ -441,7 +440,6 @@ static void g_lock_lock_retry(struct tevent_req *subreq)
 	if (!tevent_req_set_endtime(
 		    fn_state.watch_req, state->ev,
 		    timeval_current_ofs(5 + sys_random() % 5, 0))) {
-		tevent_req_oom(req);
 		return;
 	}
 	tevent_req_set_callback(fn_state.watch_req, g_lock_lock_retry, req);
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 5f786f9..394fa5f 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -438,6 +438,7 @@ static void reinit_after_fork_pipe_handler(struct tevent_context *ev,
 		 * we have reached EOF on stdin, which means the
 		 * parent has exited. Shutdown the server
 		 */
+		TALLOC_FREE(fde);
 		(void)kill(getpid(), SIGTERM);
 	}
 }
diff --git a/source3/lib/util_event.c b/source3/lib/util_event.c
index 4ca2840..ea7e7b7 100644
--- a/source3/lib/util_event.c
+++ b/source3/lib/util_event.c
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "util_event.h"
 
 struct idle_event {
 	struct tevent_timer *te;
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index c74fcd9..c97babe 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -577,7 +577,6 @@ static void open_socket_out_connected(struct tevent_req *subreq)
 		if (!tevent_req_set_endtime(
 			    subreq, state->ev,
 			    timeval_current_ofs_usec(state->wait_usec))) {
-			tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
 			return;
 		}
 		state->connect_subreq = subreq;
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 8c23f09..d2ce786 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -1666,7 +1666,6 @@ static struct tevent_req *name_queries_send(
 	if (!tevent_req_set_endtime(
 		    subreq, state->ev,
 		    timeval_current_ofs(0, state->timeout_msec * 1000))) {
-		tevent_req_oom(req);
 		return tevent_req_post(req, ev);
 	}
 	tevent_req_set_callback(subreq, name_queries_done, req);
@@ -1749,7 +1748,6 @@ static void name_queries_next(struct tevent_req *subreq)
 	if (!tevent_req_set_endtime(
 		    subreq, state->ev,
 		    timeval_current_ofs(0, state->timeout_msec * 1000))) {
-		tevent_req_oom(req);
 		return;
 	}
 	state->subreqs[state->num_sent] = subreq;
@@ -1986,7 +1984,6 @@ static struct tevent_req *query_wins_list_send(
 	}
 	if (!tevent_req_set_endtime(subreq, state->ev,
 				    timeval_current_ofs(2, 0))) {
-		tevent_req_oom(req);
 		return tevent_req_post(req, ev);
 	}
 	tevent_req_set_callback(subreq, query_wins_list_done, req);
@@ -2033,7 +2030,6 @@ static void query_wins_list_done(struct tevent_req *subreq)
 	}
 	if (!tevent_req_set_endtime(subreq, state->ev,
 				    timeval_current_ofs(2, 0))) {
-		tevent_req_oom(req);
 		return;
 	}
 	tevent_req_set_callback(subreq, query_wins_list_done, req);
diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c
index 24708c1..c4941d8 100644
--- a/source3/printing/queue_process.c
+++ b/source3/printing/queue_process.c
@@ -34,6 +34,7 @@
 #include "rpc_server/spoolss/srv_spoolss_nt.h"
 #include "auth.h"
 #include "nt_printing.h"
+#include "util_event.h"
 
 extern pid_t start_spoolssd(struct tevent_context *ev_ctx,
 			    struct messaging_context *msg_ctx);
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 516ac4c..6a3395c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -43,6 +43,7 @@
 #include "lib/util/sys_rw_data.h"
 #include "system/threads.h"
 #include "lib/pthreadpool/pthreadpool_tevent.h"
+#include "util_event.h"
 
 /* Internal message queue for deferred opens. */
 struct pending_message_list {
diff --git a/source3/torture/bench_pthreadpool.c b/source3/torture/bench_pthreadpool.c
index 4269b53..3d581e9 100644
--- a/source3/torture/bench_pthreadpool.c
+++ b/source3/torture/bench_pthreadpool.c
@@ -58,7 +58,11 @@ bool run_bench_pthreadpool(int dummy)
 		}
 	}
 
-	pthreadpool_pipe_destroy(pool);
+	if (ret != 1) {
+		return false;
+	}
+
+	ret = pthreadpool_pipe_destroy(pool);
 
-	return (ret == 1);
+	return (ret == 0);
 }
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c
index e3e54cb..b2cb838 100644
--- a/source4/libcli/smb2/session.c
+++ b/source4/libcli/smb2/session.c
@@ -163,7 +163,6 @@ struct tevent_req *smb2_session_setup_spnego_send(
 
 	ok = tevent_req_set_endtime(req, ev, endtime);
 	if (!ok) {
-		tevent_req_oom(req);
 		return tevent_req_post(req, ev);
 	}
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list