[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3357-gf2656e5

Volker Lendecke vlendec at samba.org
Sun Jul 20 16:10:51 GMT 2008


The branch, v3-3-test has been updated
       via  f2656e5c2e700523ead7a62734d203ad0caaff0c (commit)
       via  1fcfca007f33a2c4e979abf30c2ea0db65bac718 (commit)
       via  ff87127baf1d1bd62bb9c1be4a50c2ab2642b33d (commit)
       via  78e9c937ff2d2e1b70cfed4121e17feb6efafda1 (commit)
       via  ab3d80d476d8264030fa71d974324c6dcf6fe6e1 (commit)
       via  a0793cc853d3bd43df2fc49df193a5fead6b01ab (commit)
       via  513e69507676fc2227424362d24d8ea9615ea758 (commit)
       via  a13f0599551609394904b99e4014d580ec65c506 (commit)
       via  9abc9dc4dc13bd3e42f98eff64eacf24b51f5779 (commit)
       via  6c122457ff3f22e20dbb595dc6d5fb49689f4d61 (commit)
       via  9249fe9e917982c8b9ca25933b716e8ac0aa40cd (commit)
       via  d30237598d0c55b73e202c1de3a020194b67a7e6 (commit)
       via  848a3497e385090b4b21837c8d0e0313f5c062e5 (commit)
       via  b808403af55a37f2ec0e87e60450505ddfc2edda (commit)
      from  2810dc9e40a0729bc1769c00b51ef24fb5e4ea90 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit f2656e5c2e700523ead7a62734d203ad0caaff0c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open_krb5
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit 1fcfca007f33a2c4e979abf30c2ea0db65bac718
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open_schannel
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit ff87127baf1d1bd62bb9c1be4a50c2ab2642b33d
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open_ntlmssp_auth_schannel
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit 78e9c937ff2d2e1b70cfed4121e17feb6efafda1
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open_schannel_with_key
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit ab3d80d476d8264030fa71d974324c6dcf6fe6e1
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 16:36:55 2008 +0200

    Refactoring: Make get_schannel_session_key_auth_ntlmssp return NTSTATUS

commit a0793cc853d3bd43df2fc49df193a5fead6b01ab
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 16:33:26 2008 +0200

    Refactoring: Make get_schannel_session_key return NTSTATUS

commit 513e69507676fc2227424362d24d8ea9615ea758
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 16:27:45 2008 +0200

    Refactoring: Make get_schannel_session_key_common return NTSTATUS

commit a13f0599551609394904b99e4014d580ec65c506
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open_ntlmssp
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit 9abc9dc4dc13bd3e42f98eff64eacf24b51f5779
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit 6c122457ff3f22e20dbb595dc6d5fb49689f4d61
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 11:04:31 2008 +0200

    Refactoring: Change calling conventions for cli_rpc_pipe_open
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit 9249fe9e917982c8b9ca25933b716e8ac0aa40cd
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 10:56:36 2008 +0200

    Refactoring: Change calling conventions for rpc_pipe_open_np
    
    Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS

commit d30237598d0c55b73e202c1de3a020194b67a7e6
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 10:40:43 2008 +0200

    Allocate rpc_cli->dc in rpccli_netlogon_setup_creds()
    
    The general cli_pipe routines should not have to know about this NETLOGON
    speciality.

commit 848a3497e385090b4b21837c8d0e0313f5c062e5
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 10:21:14 2008 +0200

    Store copies of the syntax ids in rpc_pipe_client

commit b808403af55a37f2ec0e87e60450505ddfc2edda
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 20 10:00:46 2008 +0200

    Simplify pipe_names: we only do ndr_transfer_syntax anyway

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

Summary of changes:
 source/auth/auth_domain.c          |   10 +-
 source/client/client.c             |    5 +-
 source/include/client.h            |    4 +-
 source/include/proto.h             |   91 +++---
 source/include/rpc_dce.h           |   12 +-
 source/lib/netapi/cm.c             |    5 +-
 source/libnet/libnet_join.c        |   32 +-
 source/librpc/rpc/dcerpc.c         |   13 +-
 source/libsmb/libsmb_dir.c         |    5 +-
 source/libsmb/libsmb_server.c      |    7 +-
 source/libsmb/passchange.c         |   24 +-
 source/libsmb/trusts_util.c        |    5 +-
 source/rpc_client/cli_netlogon.c   |   11 +-
 source/rpc_client/cli_pipe.c       |  586 ++++++++++++++++++------------------
 source/rpc_parse/parse_rpc.c       |   10 +
 source/rpc_parse/parse_spoolss.c   |    1 -
 source/rpc_server/srv_spoolss.c    |    9 -
 source/rpc_server/srv_spoolss_nt.c |    3 +-
 source/rpcclient/cmd_spoolss.c     |    5 +-
 source/rpcclient/cmd_test.c        |   18 +-
 source/rpcclient/rpcclient.c       |   54 ++--
 source/smbd/change_trust_pw.c      |    5 +-
 source/utils/net_ads.c             |    4 +-
 source/utils/net_rpc.c             |   74 +++--
 source/utils/net_rpc_join.c        |   41 ++--
 source/utils/net_rpc_shell.c       |    6 +-
 source/utils/net_util.c            |   10 +-
 source/utils/netlookup.c           |    8 +-
 source/utils/smbcacls.c            |   10 +-
 source/utils/smbcquotas.c          |    6 +-
 source/utils/smbtree.c             |    5 +-
 source/winbindd/winbindd_cm.c      |   90 +++---
 32 files changed, 609 insertions(+), 560 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c
index f483718..c25e62a 100644
--- a/source/auth/auth_domain.c
+++ b/source/auth/auth_domain.c
@@ -109,13 +109,15 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
 	/* open the netlogon pipe. */
 	if (lp_client_schannel()) {
 		/* We also setup the creds chain in the open_schannel call. */
-		netlogon_pipe = cli_rpc_pipe_open_schannel(*cli, PI_NETLOGON,
-					PIPE_AUTH_LEVEL_PRIVACY, domain, &result);
+		result = cli_rpc_pipe_open_schannel(
+			*cli, &ndr_table_netlogon.syntax_id,
+			PIPE_AUTH_LEVEL_PRIVACY, domain, &netlogon_pipe);
 	} else {
-		netlogon_pipe = cli_rpc_pipe_open_noauth(*cli, PI_NETLOGON, &result);
+		result = cli_rpc_pipe_open_noauth(
+			*cli, &ndr_table_netlogon.syntax_id, &netlogon_pipe);
 	}
 
-	if(!netlogon_pipe) {
+	if (!NT_STATUS_IS_OK(result)) {
 		DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \
 machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
 		cli_shutdown(*cli);
diff --git a/source/client/client.c b/source/client/client.c
index 149b530..18b2863 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -3634,9 +3634,10 @@ static bool browse_host_rpc(bool sort)
 	uint32_t total_entries = 0;
 	int i;
 
-	pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status);
+	status = cli_rpc_pipe_open_noauth(cli, &ndr_table_srvsvc.syntax_id,
+					  &pipe_hnd);
 
-	if (pipe_hnd == NULL) {
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10, ("Could not connect to srvsvc pipe: %s\n",
 			   nt_errstr(status)));
 		TALLOC_FREE(frame);
diff --git a/source/include/client.h b/source/include/client.h
index c5882e3..9276948 100644
--- a/source/include/client.h
+++ b/source/include/client.h
@@ -76,8 +76,8 @@ struct rpc_pipe_client {
 		} sock;
 	} trans ;
 
-	const struct ndr_syntax_id *abstract_syntax;
-	const struct ndr_syntax_id *transfer_syntax;
+	struct ndr_syntax_id abstract_syntax;
+	struct ndr_syntax_id transfer_syntax;
 
 	char *desthost;
 	char *srv_name_slash;
diff --git a/source/include/proto.h b/source/include/proto.h
index ab92383..2612953 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -7101,50 +7101,52 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
 NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
 			       const struct ndr_syntax_id *abstract_syntax,
 			       struct rpc_pipe_client **presult);
-struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe_idx, NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
-						int pipe_idx,
-						enum pipe_auth_level auth_level,
-						const char *domain,
-						const char *username,
-						const char *password,
-						NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
-						int pipe_idx,
-						enum pipe_auth_level auth_level,
-						const char *domain,
-						const char *username,
-						const char *password,
-						NTSTATUS *perr);
-struct rpc_pipe_client *get_schannel_session_key(struct cli_state *cli,
-							const char *domain,
-							uint32 *pneg_flags,
-							NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
-					int pipe_idx,
-					enum pipe_auth_level auth_level,
-					const char *domain,
-					const struct dcinfo *pdc,
-					NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
-                                                int pipe_idx,
-						enum pipe_auth_level auth_level,
-                                                const char *domain,
-						const char *username,
-						const char *password,
-						NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel(struct cli_state *cli,
-                                                int pipe_idx,
-						enum pipe_auth_level auth_level,
-                                                const char *domain,
-						NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
-						int pipe_idx,
-						enum pipe_auth_level auth_level,
-						const char *service_princ,
-						const char *username,
-						const char *password,
-						NTSTATUS *perr);
+NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
+				  const struct ndr_syntax_id *interface,
+				  struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
+				   const struct ndr_syntax_id *interface,
+				   enum pipe_auth_level auth_level,
+				   const char *domain,
+				   const char *username,
+				   const char *password,
+				   struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
+					  const struct ndr_syntax_id *interface,
+					  enum pipe_auth_level auth_level,
+					  const char *domain,
+					  const char *username,
+					  const char *password,
+					  struct rpc_pipe_client **presult);
+NTSTATUS get_schannel_session_key(struct cli_state *cli,
+				  const char *domain,
+				  uint32 *pneg_flags,
+				  struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
+					     const struct ndr_syntax_id *interface,
+					     enum pipe_auth_level auth_level,
+					     const char *domain,
+					     const struct dcinfo *pdc,
+					     struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
+						 const struct ndr_syntax_id *interface,
+						 enum pipe_auth_level auth_level,
+						 const char *domain,
+						 const char *username,
+						 const char *password,
+						 struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
+				    const struct ndr_syntax_id *interface,
+				    enum pipe_auth_level auth_level,
+				    const char *domain,
+				    struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
+				const struct ndr_syntax_id *interface,
+				enum pipe_auth_level auth_level,
+				const char *service_princ,
+				const char *username,
+				const char *password,
+				struct rpc_pipe_client **presult);
 NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
 			     struct rpc_pipe_client *cli,
 			     DATA_BLOB *session_key);
@@ -7910,6 +7912,7 @@ bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
 
 const char *cli_get_pipe_name(int pipe_idx);
 int cli_get_pipe_idx(const RPC_IFACE *syntax);
+const struct ndr_syntax_id *cli_get_iface(int pipe_idx);
 void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
 				uint32 call_id, int data_len, int auth_len);
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
diff --git a/source/include/rpc_dce.h b/source/include/rpc_dce.h
index 9b2044f..b63f0ea 100644
--- a/source/include/rpc_dce.h
+++ b/source/include/rpc_dce.h
@@ -159,17 +159,9 @@ enum schannel_direction {
 /* RPC_IFACE */
 typedef struct ndr_syntax_id RPC_IFACE;
 
-#define RPC_IFACE_LEN (UUID_SIZE + 4)
-
-struct pipe_id_info {
-	/* the names appear not to matter: the syntaxes _do_ matter */
-
-	const char *client_pipe;
-	const RPC_IFACE *abstr_syntax; /* this one is the abstract syntax id */
+extern const struct ndr_syntax_id syntax_spoolss;
 
-	const char *server_pipe;  /* this one is the secondary syntax name */
-	const RPC_IFACE *trans_syntax; /* this one is the primary syntax id */
-};
+#define RPC_IFACE_LEN (UUID_SIZE + 4)
 
 /* RPC_HDR - dce rpc header */
 typedef struct rpc_hdr_info {
diff --git a/source/lib/netapi/cm.c b/source/lib/netapi/cm.c
index ae1091c..fe5490c 100644
--- a/source/lib/netapi/cm.c
+++ b/source/lib/netapi/cm.c
@@ -132,8 +132,9 @@ static struct rpc_pipe_client *pipe_cm_connect(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	p->pipe = cli_rpc_pipe_open_noauth(cli, pipe_idx, status);
-	if (!p->pipe) {
+	*status = cli_rpc_pipe_open_noauth(cli, cli_get_iface(pipe_idx),
+					   &p->pipe);
+	if (!NT_STATUS_IS_OK(*status)) {
 		TALLOC_FREE(p);
 		return NULL;
 	}
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index bb21bc4..814eeba 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -668,8 +668,9 @@ static NTSTATUS libnet_join_lookup_dc_rpc(TALLOC_CTX *mem_ctx,
 		goto done;
 	}
 
-	pipe_hnd = cli_rpc_pipe_open_noauth(*cli, PI_LSARPC, &status);
-	if (!pipe_hnd) {
+	status = cli_rpc_pipe_open_noauth(*cli, &ndr_table_lsarpc.syntax_id,
+					  &pipe_hnd);
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0,("Error connecting to LSA pipe. Error was %s\n",
 			nt_errstr(status)));
 		goto done;
@@ -750,8 +751,9 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 
 	/* Open the domain */
 
-	pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status);
-	if (!pipe_hnd) {
+	status = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+					  &pipe_hnd);
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0,("Error connecting to SAM pipe. Error was %s\n",
 			nt_errstr(status)));
 		goto done;
@@ -1022,10 +1024,9 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name,
 		return status;
 	}
 
-	netlogon_pipe = get_schannel_session_key(cli,
-						 netbios_domain_name,
-						 &neg_flags, &status);
-	if (!netlogon_pipe) {
+	status = get_schannel_session_key(cli, netbios_domain_name,
+					  &neg_flags, &netlogon_pipe);
+	if (!NT_STATUS_IS_OK(status)) {
 		if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_NETWORK_RESPONSE)) {
 			cli_shutdown(cli);
 			return NT_STATUS_OK;
@@ -1043,15 +1044,13 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name,
 		return NT_STATUS_OK;
 	}
 
-	pipe_hnd = cli_rpc_pipe_open_schannel_with_key(cli, PI_NETLOGON,
-						       PIPE_AUTH_LEVEL_PRIVACY,
-						       netbios_domain_name,
-						       netlogon_pipe->dc,
-						       &status);
+	status = cli_rpc_pipe_open_schannel_with_key(
+		cli, &ndr_table_netlogon.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
+		netbios_domain_name, netlogon_pipe->dc, &pipe_hnd);
 
 	cli_shutdown(cli);
 
-	if (!pipe_hnd) {
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0,("libnet_join_ok: failed to open schannel session "
 			"on netlogon pipe to server %s for domain %s. "
 			"Error was %s\n",
@@ -1136,8 +1135,9 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
 
 	/* Open the domain */
 
-	pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status);
-	if (!pipe_hnd) {
+	status = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+					  &pipe_hnd);
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0,("Error connecting to SAM pipe. Error was %s\n",
 			nt_errstr(status)));
 		goto done;
diff --git a/source/librpc/rpc/dcerpc.c b/source/librpc/rpc/dcerpc.c
index c8bca8d..58d676a 100644
--- a/source/librpc/rpc/dcerpc.c
+++ b/source/librpc/rpc/dcerpc.c
@@ -131,7 +131,6 @@ _PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, struct dcerpc_pipe
 	struct dcerpc_pipe *p = talloc(parent_ctx, struct dcerpc_pipe);
 	struct dcerpc_binding *binding;
 	NTSTATUS nt_status;
-	int idx;
 
 	nt_status = dcerpc_parse_binding(p, binding_string, &binding);
 
@@ -165,16 +164,10 @@ _PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, struct dcerpc_pipe
 		return nt_status;
 	}
 
-	idx = cli_get_pipe_idx(&table->syntax_id);
-	if (idx < 0) {
-		DEBUG(0, ("Unable to find interface index"));
-		talloc_free(p);
-		return NT_STATUS_OBJECT_PATH_INVALID;
-	}
-
-	p->rpc_cli = cli_rpc_pipe_open_noauth(p->cli, idx, &nt_status);
+	nt_status = cli_rpc_pipe_open_noauth(p->cli, &table->syntax_id,
+					     &p->rpc_cli);
 
-	if (p->rpc_cli == NULL) {
+	if (!NT_STATUS_IS_OK(nt_status)) {
 		talloc_free(p);
 		return nt_status;
 	}
diff --git a/source/libsmb/libsmb_dir.c b/source/libsmb/libsmb_dir.c
index aea4f10..aa313f2 100644
--- a/source/libsmb/libsmb_dir.c
+++ b/source/libsmb/libsmb_dir.c
@@ -273,8 +273,9 @@ net_share_enum_rpc(struct cli_state *cli,
 	uint32_t total_entries = 0;
 
         /* Open the server service pipe */
-        pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &nt_status);
-        if (!pipe_hnd) {
+        nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_srvsvc.syntax_id,
+					     &pipe_hnd);
+        if (!NT_STATUS_IS_OK(nt_status)) {
                 DEBUG(1, ("net_share_enum_rpc pipe open fail!\n"));
                 return -1;
         }
diff --git a/source/libsmb/libsmb_server.c b/source/libsmb/libsmb_server.c
index 7af5ca3..0a3287b 100644
--- a/source/libsmb/libsmb_server.c
+++ b/source/libsmb/libsmb_server.c
@@ -646,10 +646,9 @@ SMBC_attr_server(TALLOC_CTX *ctx,
                 ZERO_STRUCTP(ipc_srv);
                 ipc_srv->cli = ipc_cli;
                 
-                pipe_hnd = cli_rpc_pipe_open_noauth(ipc_srv->cli,
-                                                    PI_LSARPC,
-                                                    &nt_status);
-                if (!pipe_hnd) {
+                nt_status = cli_rpc_pipe_open_noauth(
+			ipc_srv->cli, &ndr_table_lsarpc.syntax_id, &pipe_hnd);
+                if (!NT_STATUS_IS_OK(nt_status)) {
                         DEBUG(1, ("cli_nt_session_open fail!\n"));
                         errno = ENOTSUP;
                         cli_shutdown(ipc_srv->cli);
diff --git a/source/libsmb/passchange.c b/source/libsmb/passchange.c
index 3b82e57..c8a4406 100644
--- a/source/libsmb/passchange.c
+++ b/source/libsmb/passchange.c
@@ -136,13 +136,13 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 	/* Try not to give the password away too easily */
 
 	if (!pass_must_change) {
-		pipe_hnd = cli_rpc_pipe_open_ntlmssp(cli,
-						PI_SAMR,
-						PIPE_AUTH_LEVEL_PRIVACY,
-						"", /* what domain... ? */
-						user_name,
-						old_passwd,
-						&result);
+		result = cli_rpc_pipe_open_ntlmssp(cli,
+						   &ndr_table_samr.syntax_id,
+						   PIPE_AUTH_LEVEL_PRIVACY,
+						   "", /* what domain... ? */
+						   user_name,
+						   old_passwd,
+						   &pipe_hnd);
 	} else {
 		/*
 		 * If the user password must be changed the ntlmssp bind will
@@ -152,10 +152,11 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 		 * will just fail. So we do it anonymously, there's no other
 		 * way.
 		 */
-		pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &result);
+		result = cli_rpc_pipe_open_noauth(
+			cli, &ndr_table_samr.syntax_id, &pipe_hnd);
 	}
 
-	if (!pipe_hnd) {
+	if (!NT_STATUS_IS_OK(result)) {
 		if (lp_client_lanman_auth()) {
 			/* Use the old RAP method. */
 			if (!cli_oem_change_password(cli, user_name, new_passwd, old_passwd)) {
@@ -204,9 +205,10 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 	result = NT_STATUS_UNSUCCESSFUL;
 	
 	/* OK, this is ugly, but... try an anonymous pipe. */
-	pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &result);
+	result = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+					  &pipe_hnd);
 
-	if ( pipe_hnd &&
+	if ( NT_STATUS_IS_OK(result) &&
 		(NT_STATUS_IS_OK(result = rpccli_samr_chgpasswd_user2(
 					 pipe_hnd, talloc_tos(), user_name,
 					 new_passwd, old_passwd)))) {
diff --git a/source/libsmb/trusts_util.c b/source/libsmb/trusts_util.c
index 6b3bbaf..f4fdf9e 100644
--- a/source/libsmb/trusts_util.c
+++ b/source/libsmb/trusts_util.c
@@ -201,8 +201,9 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
 
 	/* open the LSARPC_PIPE	*/
 
-	lsa_pipe = cli_rpc_pipe_open_noauth( cli, PI_LSARPC, &result );
-	if ( !lsa_pipe) {
+	result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+					  &lsa_pipe);
+	if (!NT_STATUS_IS_OK(result)) {
 		goto done;
 	}
 
diff --git a/source/rpc_client/cli_netlogon.c b/source/rpc_client/cli_netlogon.c
index cb1d93e..7beaae2 100644
--- a/source/rpc_client/cli_netlogon.c
+++ b/source/rpc_client/cli_netlogon.c
@@ -136,13 +136,12 @@ NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli,
 
 	SMB_ASSERT(rpccli_is_pipe_idx(cli, PI_NETLOGON));
 
-	dc = cli->dc;
-	if (!dc) {
-		return NT_STATUS_INVALID_PARAMETER;
+	TALLOC_FREE(cli->dc);
+	cli->dc = talloc_zero(cli, struct dcinfo);
+	if (cli->dc == NULL) {
+		return NT_STATUS_NO_MEMORY;
 	}
-
-	/* Ensure we don't reuse any of this state. */
-	ZERO_STRUCTP(dc);
+	dc = cli->dc;
 
 	/* Store the machine account password we're going to use. */
 	memcpy(dc->mach_pw, machine_pwd, 16);
diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c
index dc130a1..b5a188e 100644
--- a/source/rpc_client/cli_pipe.c
+++ b/source/rpc_client/cli_pipe.c
@@ -27,15 +27,6 @@
 interface/version dce/rpc pipe identification
 ********************************************************************/
 
-static const struct ndr_syntax_id syntax_spoolss = {
-	{
-		0x12345678, 0x1234, 0xabcd,
-		{ 0xef, 0x00 },
-		{ 0x01, 0x23,
-		  0x45, 0x67, 0x89, 0xab }
-	}, 0x01
-};
-
 #define PIPE_SRVSVC   "\\PIPE\\srvsvc"
 #define PIPE_SAMR     "\\PIPE\\samr"
 #define PIPE_WINREG   "\\PIPE\\winreg"
@@ -60,41 +51,30 @@ static const struct ndr_syntax_id syntax_spoolss = {
  * update the index #defines in smb.h.
  */
 
-static const struct pipe_id_info pipe_names [] =
-{
-	{ PIPE_LSARPC,		&ndr_table_lsarpc.syntax_id,
-	  PIPE_LSASS,		&ndr_transfer_syntax },
-	{ PIPE_LSARPC,		&ndr_table_dssetup.syntax_id,
-	  PIPE_LSASS,		&ndr_transfer_syntax },
-	{ PIPE_SAMR,		&ndr_table_samr.syntax_id,
-	  PIPE_LSASS,		&ndr_transfer_syntax },
-	{ PIPE_NETLOGON,	&ndr_table_netlogon.syntax_id,
-	  PIPE_LSASS,		&ndr_transfer_syntax },
-	{ PIPE_SRVSVC,		&ndr_table_srvsvc.syntax_id,
-	  PIPE_NTSVCS,		&ndr_transfer_syntax },
-	{ PIPE_WKSSVC,		&ndr_table_wkssvc.syntax_id,
-	  PIPE_NTSVCS,		&ndr_transfer_syntax },
-	{ PIPE_WINREG,		&ndr_table_winreg.syntax_id,
-	  PIPE_WINREG,		&ndr_transfer_syntax },
-	{ PIPE_SPOOLSS,		&syntax_spoolss,
-	  PIPE_SPOOLSS,		&ndr_transfer_syntax },
-	{ PIPE_NETDFS,		&ndr_table_netdfs.syntax_id,
-	  PIPE_NETDFS,		&ndr_transfer_syntax },
-	{ PIPE_ECHO,		&ndr_table_rpcecho.syntax_id,
-	  PIPE_ECHO,		&ndr_transfer_syntax },
-	{ PIPE_SHUTDOWN,	&ndr_table_initshutdown.syntax_id,
-	  PIPE_SHUTDOWN,	&ndr_transfer_syntax },
-	{ PIPE_SVCCTL,		&ndr_table_svcctl.syntax_id,
-	  PIPE_NTSVCS,		&ndr_transfer_syntax },
-	{ PIPE_EVENTLOG,	&ndr_table_eventlog.syntax_id,
-	  PIPE_EVENTLOG,	&ndr_transfer_syntax },
-	{ PIPE_NTSVCS,		&ndr_table_ntsvcs.syntax_id,
-	  PIPE_NTSVCS,		&ndr_transfer_syntax },
-	{ PIPE_EPMAPPER,	&ndr_table_epmapper.syntax_id,
-	  PIPE_EPMAPPER,	&ndr_transfer_syntax },
-	{ PIPE_DRSUAPI,		&ndr_table_drsuapi.syntax_id,
-	  PIPE_DRSUAPI,		&ndr_transfer_syntax },
-	{ NULL, NULL, NULL, NULL }
+static const struct pipe_id_info {
+	/* the names appear not to matter: the syntaxes _do_ matter */
+
+	const char *client_pipe;
+	const RPC_IFACE *abstr_syntax; /* this one is the abstract syntax id */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list