[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Jun 1 05:15:02 MDT 2011


The branch, master has been updated
       via  b5aeee7 s3-epmapper: Register ports on IPv4 too.
       via  4640d90 s3-rpc_server: Remove unused variable pipes_open.
       via  f086057 s3-rpc_server: Remove syntax from pipes_struct.
       via  751ecd9 s3-rpc_server: Fixed debug messages of srv_pipe_hnd.
       via  9f1b20e s3-rpc_server: Fixed debug messages for rpc_handles.
       via  89ced2c s3-rpc_server: Fix debug messages.
       via  e744222 s3-rpc_server: Don't segfault if there are not handles to free.
       via  438b24a s3-rpc_server: Remove guessing of the syntax id.
       via  7d800a8 s3-rpc_server: Use the correct syntax id for debugging.
       via  6b0f82e s3-rpc_server: Migrate init_pipe_handles() to new syntax.
       via  58485af s3-rpc_server: Use the context syntax id in api_pipe_request().
       via  c8ec695 s3-rpc_server: Use the correct syntax id in api_pipe_bind_req().
       via  6e8c7d0 s3-rpc_server: Use the correct context syntax.
       via  34a600a s3-rpc_server: Move the context functions to own file.
       via  e39e09f s3-rpc_server: Store the ndr syntax id in the pipe context.
       via  44fb114 s3-rpc_server: Added syntax id to pipe_rpc_fns struct.
      from  e340cd8 lib/tevent/tevent.h: minor documentation fix.

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


- Log -----------------------------------------------------------------
commit b5aeee76c926f102c3bee396c831475b1eeb18d5
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 25 17:37:51 2011 +0200

    s3-epmapper: Register ports on IPv4 too.
    
    Autobuild-User: Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date: Wed Jun  1 13:14:53 CEST 2011 on sn-devel-104

commit 4640d908f7abd0c0a96e89162adc23d1ee78b71c
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 11:35:39 2011 +0200

    s3-rpc_server: Remove unused variable pipes_open.

commit f086057ce89a5a09e26b7b0f85e598951a866851
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 13:37:11 2011 +0200

    s3-rpc_server: Remove syntax from pipes_struct.

commit 751ecd9bf7e3d657cad7de72f396a15357f9d26f
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 13:42:52 2011 +0200

    s3-rpc_server: Fixed debug messages of srv_pipe_hnd.

commit 9f1b20e971ec0760ec2b3699f72daa54073ce656
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 13:32:22 2011 +0200

    s3-rpc_server: Fixed debug messages for rpc_handles.

commit 89ced2cc49971557b23b8ae8fb804e16bed8cb6c
Author: Andreas Schneider <asn at samba.org>
Date:   Mon May 30 11:27:07 2011 +0200

    s3-rpc_server: Fix debug messages.

commit e744222e41b7c4c9b197641d3c5c87b27daf5ce8
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 25 17:26:28 2011 +0200

    s3-rpc_server: Don't segfault if there are not handles to free.

commit 438b24a77f5173d9ffee76009589033ece6e9dce
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 25 17:26:01 2011 +0200

    s3-rpc_server: Remove guessing of the syntax id.
    
    This is only a wild guess. We don't know to which rpc service the client
    wants to talk until we read the the rpc bind packet.

commit 7d800a8694e7c9bef96ae006ace5807872f375d4
Author: Andreas Schneider <asn at samba.org>
Date:   Mon May 30 11:11:48 2011 +0200

    s3-rpc_server: Use the correct syntax id for debugging.

commit 6b0f82eeab04e59657231b73fd94d33cffaadc76
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 10:53:55 2011 +0200

    s3-rpc_server: Migrate init_pipe_handles() to new syntax.

commit 58485afd91dde993cd7f14ca0182f661be4b719c
Author: Andreas Schneider <asn at samba.org>
Date:   Mon May 30 11:02:47 2011 +0200

    s3-rpc_server: Use the context syntax id in api_pipe_request().

commit c8ec695cb3646c9f38a8a54171a2bdac2b1fd5a5
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 25 16:58:18 2011 +0200

    s3-rpc_server: Use the correct syntax id in api_pipe_bind_req().

commit 6e8c7d08344158714041bbe5b344b453d8b7c225
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 13:33:05 2011 +0200

    s3-rpc_server: Use the correct context syntax.

commit 34a600a27f5b288a9185b6d32c7252b9f5a81a09
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 31 10:28:39 2011 +0200

    s3-rpc_server: Move the context functions to own file.

commit e39e09ffb5baa527b03454c905ccd1292fa9c93f
Author: Andreas Schneider <asn at samba.org>
Date:   Wed May 25 16:03:43 2011 +0200

    s3-rpc_server: Store the ndr syntax id in the pipe context.
    
    The client tell us in the rpc bind to which rpc service it wants to
    connect. We did set the p->syntax earlier by guessing to which pipe name
    it connects, but we don't know to which rpc service it wants to bind
    until we read the first packet.

commit 44fb1140bb92259f10852e24bde82a13f926ca15
Author: Andreas Schneider <asn at samba.org>
Date:   Mon May 30 10:40:37 2011 +0200

    s3-rpc_server: Added syntax id to pipe_rpc_fns struct.

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

Summary of changes:
 source3/Makefile.in                                |    3 +-
 source3/include/ntdomain.h                         |    4 +-
 source3/rpc_server/epmd.c                          |    5 +-
 source3/rpc_server/{srv_pipe.h => rpc_contexts.c}  |   27 ++--
 .../rpc_contexts.h}                                |   14 +-
 source3/rpc_server/rpc_ep_setup.c                  |   12 +--
 source3/rpc_server/rpc_handles.c                   |   46 ++++--
 source3/rpc_server/rpc_ncacn_np.c                  |   29 +++-
 source3/rpc_server/rpc_server.c                    |   39 +----
 source3/rpc_server/rpc_server.h                    |    2 -
 source3/rpc_server/srv_pipe.c                      |  171 ++++++++------------
 source3/rpc_server/srv_pipe_hnd.c                  |   10 +-
 source3/rpc_server/wscript_build                   |    2 +-
 13 files changed, 160 insertions(+), 204 deletions(-)
 copy source3/rpc_server/{srv_pipe.h => rpc_contexts.c} (63%)
 copy source3/{printing/nt_printing_migrate.h => rpc_server/rpc_contexts.h} (70%)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index c768a40..f95fbeb 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -727,7 +727,8 @@ NPA_TSTREAM_OBJ = ../libcli/named_pipe_auth/npa_tstream.o \
 		  ../auth/auth_sam_reply.o librpc/gen_ndr/ndr_auth.o ../librpc/ndr/ndr_auth.o
 
 RPC_NCACN_NP = rpc_server/srv_pipe_register.o rpc_server/rpc_ncacn_np.o \
-	       rpc_server/rpc_handles.o rpc_server/srv_access_check.o
+	       rpc_server/rpc_handles.o rpc_server/rpc_contexts.o \
+	       rpc_server/srv_access_check.o
 
 RPC_SERVICE = rpc_server/rpc_server.o
 
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index ed97182..ff72873 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -86,7 +86,8 @@ typedef struct pipe_rpc_fns {
 
 	const struct api_struct *cmds;
 	int n_cmds;
-	uint32 context_id;
+	uint32_t context_id;
+	struct ndr_syntax_id syntax;
 
 } PIPE_RPC_FNS;
 
@@ -115,7 +116,6 @@ struct pipes_struct {
 	struct auth_serversupplied_info *session_info;
 	struct messaging_context *msg_ctx;
 
-	struct ndr_syntax_id syntax;
 	struct dcesrv_ep_entry_list *ep_entries;
 
 	/* linked list of rpc dispatch tables associated 
diff --git a/source3/rpc_server/epmd.c b/source3/rpc_server/epmd.c
index 4e2056e..bb241ff 100644
--- a/source3/rpc_server/epmd.c
+++ b/source3/rpc_server/epmd.c
@@ -54,7 +54,6 @@ static bool epmd_open_sockets(struct tevent_context *ev_ctx,
 
 			port = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
 							       msg_ctx,
-							       ndr_table_epmapper.syntax_id,
 							       ifss,
 							       135);
 			if (port == 0) {
@@ -69,7 +68,7 @@ static bool epmd_open_sockets(struct tevent_context *ev_ctx,
 		if (strequal(sock_addr, "0.0.0.0") ||
 		    strequal(sock_addr, "::")) {
 #if HAVE_IPV6
-			sock_addr = "::";
+			sock_addr = "::,0.0.0.0";
 #else
 			sock_addr = "0.0.0.0";
 #endif
@@ -89,7 +88,6 @@ static bool epmd_open_sockets(struct tevent_context *ev_ctx,
 
 			port = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
 							       msg_ctx,
-							       ndr_table_epmapper.syntax_id,
 							       &ss,
 							       135);
 			if (port == 0) {
@@ -263,7 +261,6 @@ void start_epmd(struct tevent_context *ev_ctx,
 
 	ok = setup_dcerpc_ncalrpc_socket(ev_ctx,
 					 msg_ctx,
-					 ndr_table_epmapper.syntax_id,
 					 "EPMAPPER",
 					 srv_epmapper_delete_endpoints);
 	if (!ok) {
diff --git a/source3/rpc_server/srv_pipe.h b/source3/rpc_server/rpc_contexts.c
similarity index 63%
copy from source3/rpc_server/srv_pipe.h
copy to source3/rpc_server/rpc_contexts.c
index 453cca1..bb5c0ea 100644
--- a/source3/rpc_server/srv_pipe.h
+++ b/source3/rpc_server/rpc_contexts.c
@@ -17,17 +17,24 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _RPC_SERVER_SRV_PIPE_H_
-#define _RPC_SERVER_SRV_PIPE_H_
+#include "includes.h"
+#include "ntdomain.h"
 
-struct ncacn_packet;
-struct pipes_struct;
+#include "rpc_contexts.h"
 
-/* The following definitions come from rpc_server/srv_pipe.c  */
+struct pipe_rpc_fns *find_pipe_fns_by_context(struct pipe_rpc_fns *list,
+					      uint32_t context_id)
+{
+	struct pipe_rpc_fns *fns = NULL;
 
-bool create_next_pdu(struct pipes_struct *p);
-bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt);
-bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status);
-bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax);
+	if ( !list ) {
+		DEBUG(0,("find_pipe_fns_by_context: ERROR!  No context list for pipe!\n"));
+		return NULL;
+	}
 
-#endif /* _RPC_SERVER_SRV_PIPE_H_ */
+	for (fns=list; fns; fns=fns->next ) {
+		if ( fns->context_id == context_id )
+			return fns;
+	}
+	return NULL;
+}
diff --git a/source3/printing/nt_printing_migrate.h b/source3/rpc_server/rpc_contexts.h
similarity index 70%
copy from source3/printing/nt_printing_migrate.h
copy to source3/rpc_server/rpc_contexts.h
index 9ab2fa7..8463414 100644
--- a/source3/printing/nt_printing_migrate.h
+++ b/source3/rpc_server/rpc_contexts.h
@@ -1,8 +1,7 @@
 /*
  *  Unix SMB/CIFS implementation.
  *  RPC Pipe client / server routines
- *
- *  Copyright (c) Andreas Schneider            2010.
+ *  Almost completely rewritten by (C) Jeremy Allison 2005 - 2010
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -18,9 +17,12 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _NT_PRINTING_MIGRATE_H_
-#define _NT_PRINTING_MIGRATE_H_
+#ifndef _RPC_SERVER_RPC_CONTEXTS_H_
+#define _RPC_SERVER_RPC_CONTEXTS_H_
+
+struct pipe_rpc_fns;
 
-bool nt_printing_tdb_migrate(struct messaging_context *msg_ctx);
+struct pipe_rpc_fns *find_pipe_fns_by_context(struct pipe_rpc_fns *list,
+					      uint32_t context_id);
 
-#endif /* _NT_PRINTING_MIGRATE_H_ */
+#endif /* _RPC_SERVER_RPC_CONTEXTS_H_*/
diff --git a/source3/rpc_server/rpc_ep_setup.c b/source3/rpc_server/rpc_ep_setup.c
index 918bcd4..e5059da 100644
--- a/source3/rpc_server/rpc_ep_setup.c
+++ b/source3/rpc_server/rpc_ep_setup.c
@@ -79,7 +79,6 @@ static uint16_t _open_sockets(struct tevent_context *ev_ctx,
 
 			p = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
 							    msg_ctx,
-							    syntax_id,
 							    ifss,
 							    port);
 			if (p == 0) {
@@ -95,7 +94,7 @@ static uint16_t _open_sockets(struct tevent_context *ev_ctx,
 		if (strequal(sock_addr, "0.0.0.0") ||
 		    strequal(sock_addr, "::")) {
 #if HAVE_IPV6
-			sock_addr = "::";
+			sock_addr = "::,0.0.0.0";
 #else
 			sock_addr = "0.0.0.0";
 #endif
@@ -115,7 +114,6 @@ static uint16_t _open_sockets(struct tevent_context *ev_ctx,
 
 			p = setup_dcerpc_ncacn_tcpip_socket(ev_ctx,
 							    msg_ctx,
-							    syntax_id,
 							    &ss,
 							    port);
 			if (p == 0) {
@@ -430,7 +428,6 @@ static bool winreg_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -478,7 +475,6 @@ static bool srvsvc_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -527,7 +523,6 @@ static bool lsarpc_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -576,7 +571,6 @@ static bool samr_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -625,7 +619,6 @@ static bool netlogon_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -890,7 +883,6 @@ static bool netdfs_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -939,7 +931,6 @@ static bool dssetup_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
@@ -987,7 +978,6 @@ static bool wkssvc_init_cb(void *ptr)
 
 		ok = setup_dcerpc_ncalrpc_socket(ep_ctx->ev_ctx,
 						 ep_ctx->msg_ctx,
-						 abstract_syntax,
 						 pipe_name,
 						 NULL);
 		if (!ok) {
diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c
index 493149b..0b30251 100644
--- a/source3/rpc_server/rpc_handles.c
+++ b/source3/rpc_server/rpc_handles.c
@@ -84,15 +84,28 @@ bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *synta
 	for (plist = get_first_internal_pipe();
 	     plist;
 	     plist = get_next_internal_pipe(plist)) {
-		if (ndr_syntax_id_equal(syntax, &plist->syntax)) {
-			break;
+		struct pipe_rpc_fns *p_ctx;
+		bool stop = false;
+
+		for (p_ctx = plist->contexts;
+		     p_ctx != NULL;
+		     p_ctx = p_ctx->next) {
+			if (ndr_syntax_id_equal(syntax, &p_ctx->syntax)) {
+				stop = true;
+				break;
+			}
+			if (is_samr_lsa_pipe(&p_ctx->syntax)
+			    && is_samr_lsa_pipe(syntax)) {
+				/*
+				 * samr and lsa share a handle space (same process
+				 * under Windows?)
+				 */
+				stop = true;
+				break;
+			}
 		}
-		if (is_samr_lsa_pipe(&plist->syntax)
-		    && is_samr_lsa_pipe(syntax)) {
-			/*
-			 * samr and lsa share a handle space (same process
-			 * under Windows?)
-			 */
+
+		if (stop) {
 			break;
 		}
 	}
@@ -294,6 +307,10 @@ bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd)
 
 void close_policy_by_pipe(struct pipes_struct *p)
 {
+	if (p->pipe_handles == NULL) {
+		return;
+	}
+
 	p->pipe_handles->pipe_ref_count--;
 
 	if (p->pipe_handles->pipe_ref_count == 0) {
@@ -302,9 +319,9 @@ void close_policy_by_pipe(struct pipes_struct *p)
 		 */
 		TALLOC_FREE(p->pipe_handles);
 
-		DEBUG(10,("close_policy_by_pipe: deleted handle list for "
-			  "pipe %s\n",
-			  get_pipe_name_from_syntax(talloc_tos(), &p->syntax)));
+		DEBUG(10,("Deleted handle list for RPC connection %s\n",
+			  get_pipe_name_from_syntax(talloc_tos(),
+						    &p->contexts->syntax)));
 	}
 }
 
@@ -345,9 +362,10 @@ void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
 	void *data;
 
 	if (p->pipe_handles->count > MAX_OPEN_POLS) {
-		DEBUG(0, ("policy_handle_create: ERROR: too many handles (%d) "
-			  "on pipe %s.\n", (int)p->pipe_handles->count,
-			  get_pipe_name_from_syntax(talloc_tos(), &p->syntax)));
+		DEBUG(0, ("ERROR: Too many handles (%d) for RPC connection %s\n",
+			  get_pipe_name_from_syntax(talloc_tos(),
+						    &p->contexts->syntax),
+			  (int) p->pipe_handles->count));
 		*pstatus = NT_STATUS_INSUFFICIENT_RESOURCES;
 		return NULL;
 	}
diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c
index 36ee303..4446578 100644
--- a/source3/rpc_server/rpc_ncacn_np.c
+++ b/source3/rpc_server/rpc_ncacn_np.c
@@ -33,12 +33,11 @@
 #include "ntdomain.h"
 #include "../lib/tsocket/tsocket.h"
 #include "../lib/util/tevent_ntstatus.h"
+#include "rpc_contexts.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
 
-static int pipes_open;
-
 static struct pipes_struct *InternalPipes;
 
 /* TODO
@@ -127,6 +126,7 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
 					      struct messaging_context *msg_ctx)
 {
 	struct pipes_struct *p;
+	struct pipe_rpc_fns *context_fns;
 
 	DEBUG(4,("Create pipe requested %s\n",
 		 get_pipe_name_from_syntax(talloc_tos(), syntax)));
@@ -169,11 +169,25 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
 
 	p->endian = RPC_LITTLE_ENDIAN;
 
-	p->syntax = *syntax;
 	p->transport = NCALRPC;
 
-	DEBUG(4,("Created internal pipe %s (pipes_open=%d)\n",
-		 get_pipe_name_from_syntax(talloc_tos(), syntax), pipes_open));
+	context_fns = SMB_MALLOC_P(struct pipe_rpc_fns);
+	if (context_fns == NULL) {
+		DEBUG(0,("malloc() failed!\n"));
+		return False;
+	}
+
+	context_fns->next = context_fns->prev = NULL;
+	context_fns->n_cmds = rpc_srv_get_pipe_num_cmds(syntax);
+	context_fns->cmds = rpc_srv_get_pipe_cmds(syntax);
+	context_fns->context_id = 0;
+	context_fns->syntax = *syntax;
+
+	/* add to the list of open contexts */
+	DLIST_ADD(p->contexts, context_fns);
+
+	DEBUG(4,("Created internal pipe %s\n",
+		 get_pipe_name_from_syntax(talloc_tos(), syntax)));
 
 	talloc_set_destructor(p, close_internal_rpc_pipe_hnd);
 
@@ -186,8 +200,9 @@ static NTSTATUS rpcint_dispatch(struct pipes_struct *p,
 				const DATA_BLOB *in_data,
 				DATA_BLOB *out_data)
 {
-	uint32_t num_cmds = rpc_srv_get_pipe_num_cmds(&p->syntax);
-	const struct api_struct *cmds = rpc_srv_get_pipe_cmds(&p->syntax);
+	struct pipe_rpc_fns *fns = find_pipe_fns_by_context(p->contexts, 0);
+	uint32_t num_cmds = fns->n_cmds;
+	const struct api_struct *cmds = fns->cmds;
 	uint32_t i;
 	bool ok;
 
diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c
index 3f81a2f..44c1b10 100644
--- a/source3/rpc_server/rpc_server.c
+++ b/source3/rpc_server/rpc_server.c
@@ -79,7 +79,6 @@ static NTSTATUS auth_anonymous_session_info(TALLOC_CTX *mem_ctx,
  * sent from the client */
 static int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
 				    const char *pipe_name,
-				    const struct ndr_syntax_id id,
 				    enum dcerpc_transport_t transport,
 				    bool ncalrpc_as_system,
 				    const char *client_address,
@@ -93,14 +92,13 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
 	struct pipes_struct *p;
 	struct auth_serversupplied_info *server_info;
 	NTSTATUS status;
-	bool ok;
 
 	p = talloc_zero(mem_ctx, struct pipes_struct);
 	if (!p) {
 		*perrno = ENOMEM;
 		return -1;
 	}
-	p->syntax = id;
+
 	p->transport = transport;
 	p->ncalrpc_as_system = ncalrpc_as_system;
 
@@ -111,15 +109,6 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
 		return -1;
 	}
 
-	ok = init_pipe_handles(p, &id);
-	if (!ok) {
-		DEBUG(1, ("Failed to init handles\n"));
-		TALLOC_FREE(p);
-		*perrno = EINVAL;
-		return -1;
-	}
-
-
 	data_blob_free(&p->in_data.data);
 	data_blob_free(&p->in_data.pdu);
 
@@ -354,7 +343,6 @@ static void named_pipe_listener(struct tevent_context *ev,
 
 struct named_pipe_client {
 	const char *pipe_name;
-	struct ndr_syntax_id pipe_id;
 
 	struct tevent_context *ev;
 	struct messaging_context *msg_ctx;
@@ -383,20 +371,11 @@ static void named_pipe_accept_done(struct tevent_req *subreq);
 
 static void named_pipe_accept_function(const char *pipe_name, int fd)
 {
-	struct ndr_syntax_id syntax;
 	struct named_pipe_client *npc;
 	struct tstream_context *plain;
 	struct tevent_req *subreq;
-	bool ok;
 	int ret;
 
-	ok = is_known_pipename(pipe_name, &syntax);
-	if (!ok) {
-		DEBUG(1, ("Unknown pipe [%s]\n", pipe_name));
-		close(fd);
-		return;
-	}
-
 	npc = talloc_zero(NULL, struct named_pipe_client);
 	if (!npc) {
 		DEBUG(0, ("Out of memory!\n"));
@@ -404,7 +383,6 @@ static void named_pipe_accept_function(const char *pipe_name, int fd)
 		return;
 	}
 	npc->pipe_name = pipe_name;
-	npc->pipe_id = syntax;
 	npc->ev = server_event_context();
 	npc->msg_ctx = server_messaging_context();
 
@@ -484,7 +462,7 @@ static void named_pipe_accept_done(struct tevent_req *subreq)
 	}
 
 	ret = make_server_pipes_struct(npc,
-					npc->pipe_name, npc->pipe_id, NCACN_NP,
+				       npc->pipe_name, NCACN_NP,
 					false, cli_addr, NULL, npc->session_info,
 					&npc->p, &error);
 	if (ret != 0) {
@@ -693,7 +671,6 @@ fail:
 
 static void dcerpc_ncacn_accept(struct tevent_context *ev_ctx,
 				struct messaging_context *msg_ctx,
-				struct ndr_syntax_id syntax_id,
 				enum dcerpc_transport_t transport,
 				const char *name,
 				uint16_t port,
@@ -713,7 +690,6 @@ static void dcerpc_ncacn_tcpip_listener(struct tevent_context *ev,
 
 uint16_t setup_dcerpc_ncacn_tcpip_socket(struct tevent_context *ev_ctx,
 					 struct messaging_context *msg_ctx,
-					 struct ndr_syntax_id syntax_id,
 					 const struct sockaddr_storage *ifss,
 					 uint16_t port)
 {
@@ -727,7 +703,6 @@ uint16_t setup_dcerpc_ncacn_tcpip_socket(struct tevent_context *ev_ctx,
 		return 0;
 	}
 
-	state->syntax_id = syntax_id;
 	state->fd = -1;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list