[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon Oct 21 04:50:04 MDT 2013


The branch, master has been updated
       via  5ea154b s3-rpc_server: Refactor lsasd_create_sockets().
       via  b58df3d lsasd: Fix CID 1107233 Double close
      from  28cdd1c winbind3: Fix CID 1107229 Uninitialized pointer read

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


- Log -----------------------------------------------------------------
commit 5ea154bf25b6269e5c8d3c30bed88defc785f4ae
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Oct 21 08:26:47 2013 +0200

    s3-rpc_server: Refactor lsasd_create_sockets().
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Mon Oct 21 12:49:44 CEST 2013 on sn-devel-104

commit b58df3d2bc2599c4ad359f72810395d00bdcd518
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Oct 20 17:37:08 2013 +0200

    lsasd: Fix CID 1107233 Double close
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 source3/rpc_server/lsasd.c |   39 +++++----------------------------------
 1 files changed, 5 insertions(+), 34 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/lsasd.c b/source3/rpc_server/lsasd.c
index 8d2245a..375f409 100644
--- a/source3/rpc_server/lsasd.c
+++ b/source3/rpc_server/lsasd.c
@@ -604,7 +604,7 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	uint32_t i;
 	int fd = -1;
 	int rc;
-	bool ok = true;
+	bool ok = false;
 
 	tmp_ctx = talloc_stackframe();
 	if (tmp_ctx == NULL) {
@@ -613,7 +613,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	status = dcerpc_binding_vector_new(tmp_ctx, &v_orig);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
@@ -624,7 +623,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 					  listen_fd,
 					  listen_fd_size);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
@@ -634,7 +632,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 		if (rc == -1) {
 			DEBUG(0, ("Failed to listen on tcpip socket - %s\n",
 				  strerror(errno)));
-			ok = false;
 			goto done;
 		}
 	}
@@ -642,7 +639,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	/* LSARPC */
 	fd = create_named_pipe_socket("lsarpc");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -650,7 +646,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on lsarpc pipe - %s\n",
 			  strerror(errno)));
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -658,7 +653,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	fd = create_named_pipe_socket("lsass");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -666,7 +660,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on lsass pipe - %s\n",
 			  strerror(errno)));
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -674,7 +667,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	fd = create_dcerpc_ncalrpc_socket("lsarpc");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -682,7 +674,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on lsarpc ncalrpc - %s\n",
 			  strerror(errno)));
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -691,37 +682,32 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	v = dcerpc_binding_vector_dup(tmp_ctx, v_orig);
 	if (v == NULL) {
-		ok = false;
 		goto done;
 	}
 
 	status = dcerpc_binding_vector_replace_iface(&ndr_table_lsarpc, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		return false;
+		goto done;
 	}
 
 	status = dcerpc_binding_vector_add_np_default(&ndr_table_lsarpc, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "lsarpc");
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_lsarpc, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	/* SAMR */
 	fd = create_named_pipe_socket("samr");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -729,7 +715,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on samr pipe - %s\n",
 			  strerror(errno)));
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -737,7 +722,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	fd = create_dcerpc_ncalrpc_socket("samr");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -745,7 +729,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on samr ncalrpc - %s\n",
 			  strerror(errno)));
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -754,37 +737,32 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	v = dcerpc_binding_vector_dup(tmp_ctx, v_orig);
 	if (v == NULL) {
-		ok = false;
 		goto done;
 	}
 
 	status = dcerpc_binding_vector_replace_iface(&ndr_table_samr, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		return false;
+		goto done;
 	}
 
 	status = dcerpc_binding_vector_add_np_default(&ndr_table_samr, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "samr");
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_samr, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	/* NETLOGON */
 	fd = create_named_pipe_socket("netlogon");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -792,7 +770,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on samr pipe - %s\n",
 			  strerror(errno)));
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -800,7 +777,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	fd = create_dcerpc_ncalrpc_socket("netlogon");
 	if (fd < 0) {
-		ok = false;
 		goto done;
 	}
 
@@ -808,8 +784,6 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 	if (rc == -1) {
 		DEBUG(0, ("Failed to listen on netlogon ncalrpc - %s\n",
 			  strerror(errno)));
-		close(fd);
-		ok = false;
 		goto done;
 	}
 	listen_fd[*listen_fd_size] = fd;
@@ -818,33 +792,30 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx,
 
 	v = dcerpc_binding_vector_dup(tmp_ctx, v_orig);
 	if (v == NULL) {
-		ok = false;
 		goto done;
 	}
 
 	status = dcerpc_binding_vector_replace_iface(&ndr_table_netlogon, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		return false;
+		goto done;
 	}
 
 	status = dcerpc_binding_vector_add_np_default(&ndr_table_netlogon, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "netlogon");
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
 	status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_netlogon, v);
 	if (!NT_STATUS_IS_OK(status)) {
-		ok = false;
 		goto done;
 	}
 
+	ok = true;
 done:
 	if (fd != -1) {
 		close(fd);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list