[SCM] Samba Shared Repository - branch v3-6-test updated

Günther Deschner gd at samba.org
Wed Feb 2 06:38:50 MST 2011


The branch, v3-6-test has been updated
       via  30aea57 s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_msrpc.c.
       via  4937ee6 s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_pam.c.
       via  8887005 s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_rpc.c.
       via  bb13f32 s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_samr.c.
       via  f96b0f7 s3-winbind: prefer dcerpc_samr_X functions in invalidate_cm_connection.
       via  e814e34 s3-winbind: prefer dcerpc_samr_X functions in cm_connect_sam.
       via  f482c03 s3-winbind: use status variable name in cm_connect_sam.
      from  b70e87c Add knownfail for s4 for the new oplock test.

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


- Log -----------------------------------------------------------------
commit 30aea57d4585c3a474cf64f6d3b15d360a040906
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 14:06:48 2011 +0100

    s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_msrpc.c.
    
    Guenther
    
    Autobuild-User: Günther Deschner <gd at samba.org>
    Autobuild-Date: Wed Feb  2 14:14:43 CET 2011 on sn-devel-104
    (cherry picked from commit e026685b7cb579471f64835c6e527cf1818eb384)

commit 4937ee610f72ebec74399adc2064912b2957bb34
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 13:56:26 2011 +0100

    s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_pam.c.
    
    Guenther
    (cherry picked from commit 6c20ba3f971984279767899c329b0d21e8e1b436)

commit 8887005eb67c71cafcccc5368c4c647cf506b5bb
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 13:07:18 2011 +0100

    s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_rpc.c.
    
    Guenther
    (cherry picked from commit 924f60c77cb931d29ee6bb99b2bfd7298585b039)

commit bb13f3250f4fe96bb74e79e20689dc9c8339c90e
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 12:43:02 2011 +0100

    s3-winbind: prefer dcerpc_samr_X functions in winbindd/winbindd_samr.c.
    
    Guenther
    (cherry picked from commit 58cdc56acc51de618a806a80b251f8ef6d573658)

commit f96b0f7587ddef48e4dcfa0a3cf0efd4d4da2b6f
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 12:42:00 2011 +0100

    s3-winbind: prefer dcerpc_samr_X functions in invalidate_cm_connection.
    
    Guenther
    (cherry picked from commit f21f9192f140d326d9904f1b936f1f8ceb707a02)

commit e814e34d9ec9e9a1b781d81ad6f5c4c826edb46a
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 12:40:47 2011 +0100

    s3-winbind: prefer dcerpc_samr_X functions in cm_connect_sam.
    
    Guenther
    (cherry picked from commit 39c6809eeb46a2be3de5b586483c28d32138229c)

commit f482c03449a849f4b43bf325fc9d271bca371ce3
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 18 12:25:10 2011 +0100

    s3-winbind: use status variable name in cm_connect_sam.
    
    Guenther
    (cherry picked from commit 02a8e1e490de7fca82cc689f4281bab86430a2df)

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

Summary of changes:
 source3/winbindd/winbindd_cm.c    |  109 +++++++++++++--------
 source3/winbindd/winbindd_msrpc.c |   83 +++++++++++-----
 source3/winbindd/winbindd_pam.c   |   50 +++++++---
 source3/winbindd/winbindd_rpc.c   |  192 ++++++++++++++++++++++++++-----------
 source3/winbindd/winbindd_samr.c  |  135 ++++++++++++++++++--------
 5 files changed, 389 insertions(+), 180 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 8e29b7d..98598cf 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -63,7 +63,7 @@
 #include "../libcli/auth/libcli_auth.h"
 #include "../librpc/gen_ndr/ndr_netlogon_c.h"
 #include "rpc_client/cli_netlogon.h"
-#include "../librpc/gen_ndr/cli_samr.h"
+#include "../librpc/gen_ndr/ndr_samr_c.h"
 #include "../librpc/gen_ndr/cli_lsa.h"
 #include "rpc_client/cli_lsarpc.h"
 #include "../librpc/gen_ndr/ndr_dssetup_c.h"
@@ -1635,8 +1635,11 @@ void invalidate_cm_connection(struct winbindd_cm_conn *conn)
 
 	if (conn->samr_pipe != NULL) {
 		if (is_valid_policy_hnd(&conn->sam_connect_handle)) {
-			rpccli_samr_Close(conn->samr_pipe, talloc_tos(),
-					  &conn->sam_connect_handle);
+			NTSTATUS result;
+			dcerpc_samr_Close(conn->samr_pipe->binding_handle,
+					  talloc_tos(),
+					  &conn->sam_connect_handle,
+					  &result);
 		}
 		TALLOC_FREE(conn->samr_pipe);
 		/* Ok, it must be dead. Drop timeout to 0.5 sec. */
@@ -2146,7 +2149,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 			struct rpc_pipe_client **cli, struct policy_handle *sam_handle)
 {
 	struct winbindd_cm_conn *conn;
-	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+	NTSTATUS status, result;
 	struct netlogon_creds_CredentialState *p_creds;
 	char *machine_password = NULL;
 	char *machine_account = NULL;
@@ -2156,9 +2159,9 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 		return open_internal_samr_conn(mem_ctx, domain, cli, sam_handle);
 	}
 
-	result = init_dc_connection_rpc(domain);
-	if (!NT_STATUS_IS_OK(result)) {
-		return result;
+	status = init_dc_connection_rpc(domain);
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
 	}
 
 	conn = &domain->conn;
@@ -2180,9 +2183,9 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 	    (conn->cli->domain[0] == '\0') || 
 	    (conn->cli->password == NULL || conn->cli->password[0] == '\0'))
 	{
-		result = get_trust_creds(domain, &machine_password,
+		status = get_trust_creds(domain, &machine_password,
 					 &machine_account, NULL);
-		if (!NT_STATUS_IS_OK(result)) {
+		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(10, ("cm_connect_sam: No no user available for "
 				   "domain %s, trying schannel\n", conn->cli->domain));
 			goto schannel;
@@ -2195,13 +2198,13 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 	}
 
 	if (!machine_password || !machine_account) {
-		result = NT_STATUS_NO_MEMORY;
+		status = NT_STATUS_NO_MEMORY;
 		goto done;
 	}
 
 	/* We have an authenticated connection. Use a NTLMSSP SPNEGO
 	   authenticated SAMR pipe with sign & seal. */
-	result = cli_rpc_pipe_open_spnego_ntlmssp(conn->cli,
+	status = cli_rpc_pipe_open_spnego_ntlmssp(conn->cli,
 						  &ndr_table_samr.syntax_id,
 						  NCACN_NP,
 						  DCERPC_AUTH_LEVEL_PRIVACY,
@@ -2210,12 +2213,12 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 						  machine_password,
 						  &conn->samr_pipe);
 
-	if (!NT_STATUS_IS_OK(result)) {
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10,("cm_connect_sam: failed to connect to SAMR "
 			  "pipe for domain %s using NTLMSSP "
 			  "authenticated pipe: user %s\\%s. Error was "
 			  "%s\n", domain->name, domain_name,
-			  machine_account, nt_errstr(result)));
+			  machine_account, nt_errstr(status)));
 		goto schannel;
 	}
 
@@ -2224,89 +2227,111 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 		  "pipe: user %s\\%s\n", domain->name,
 		  domain_name, machine_account));
 
-	result = rpccli_samr_Connect2(conn->samr_pipe, mem_ctx,
+	status = dcerpc_samr_Connect2(conn->samr_pipe->binding_handle, mem_ctx,
 				      conn->samr_pipe->desthost,
 				      SEC_FLAG_MAXIMUM_ALLOWED,
-				      &conn->sam_connect_handle);
-	if (NT_STATUS_IS_OK(result)) {
+				      &conn->sam_connect_handle,
+				      &result);
+	if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(result)) {
 		goto open_domain;
 	}
-	DEBUG(10,("cm_connect_sam: ntlmssp-sealed rpccli_samr_Connect2 "
+	if (NT_STATUS_IS_OK(status)) {
+		status = result;
+	}
+
+	DEBUG(10,("cm_connect_sam: ntlmssp-sealed dcerpc_samr_Connect2 "
 		  "failed for domain %s, error was %s. Trying schannel\n",
-		  domain->name, nt_errstr(result) ));
+		  domain->name, nt_errstr(status) ));
 	TALLOC_FREE(conn->samr_pipe);
 
  schannel:
 
 	/* Fall back to schannel if it's a W2K pre-SP1 box. */
 
-	result = cm_get_schannel_creds(domain, &p_creds);
-	if (!NT_STATUS_IS_OK(result)) {
+	status = cm_get_schannel_creds(domain, &p_creds);
+	if (!NT_STATUS_IS_OK(status)) {
 		/* If this call fails - conn->cli can now be NULL ! */
 		DEBUG(10, ("cm_connect_sam: Could not get schannel auth info "
 			   "for domain %s (error %s), trying anon\n",
 			domain->name,
-			nt_errstr(result) ));
+			nt_errstr(status) ));
 		goto anonymous;
 	}
-	result = cli_rpc_pipe_open_schannel_with_key
+	status = cli_rpc_pipe_open_schannel_with_key
 		(conn->cli, &ndr_table_samr.syntax_id, NCACN_NP,
 		 DCERPC_AUTH_LEVEL_PRIVACY,
 		 domain->name, &p_creds, &conn->samr_pipe);
 
-	if (!NT_STATUS_IS_OK(result)) {
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10,("cm_connect_sam: failed to connect to SAMR pipe for "
 			  "domain %s using schannel. Error was %s\n",
-			  domain->name, nt_errstr(result) ));
+			  domain->name, nt_errstr(status) ));
 		goto anonymous;
 	}
 	DEBUG(10,("cm_connect_sam: connected to SAMR pipe for domain %s using "
 		  "schannel.\n", domain->name ));
 
-	result = rpccli_samr_Connect2(conn->samr_pipe, mem_ctx,
+	status = dcerpc_samr_Connect2(conn->samr_pipe->binding_handle, mem_ctx,
 				      conn->samr_pipe->desthost,
 				      SEC_FLAG_MAXIMUM_ALLOWED,
-				      &conn->sam_connect_handle);
-	if (NT_STATUS_IS_OK(result)) {
+				      &conn->sam_connect_handle,
+				      &result);
+	if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(result)) {
 		goto open_domain;
 	}
-	DEBUG(10,("cm_connect_sam: schannel-sealed rpccli_samr_Connect2 failed "
+	if (NT_STATUS_IS_OK(status)) {
+		status = result;
+	}
+	DEBUG(10,("cm_connect_sam: schannel-sealed dcerpc_samr_Connect2 failed "
 		  "for domain %s, error was %s. Trying anonymous\n",
-		  domain->name, nt_errstr(result) ));
+		  domain->name, nt_errstr(status) ));
 	TALLOC_FREE(conn->samr_pipe);
 
  anonymous:
 
 	/* Finally fall back to anonymous. */
-	result = cli_rpc_pipe_open_noauth(conn->cli, &ndr_table_samr.syntax_id,
+	status = cli_rpc_pipe_open_noauth(conn->cli, &ndr_table_samr.syntax_id,
 					  &conn->samr_pipe);
 
-	if (!NT_STATUS_IS_OK(result)) {
+	if (!NT_STATUS_IS_OK(status)) {
 		goto done;
 	}
 
-	result = rpccli_samr_Connect2(conn->samr_pipe, mem_ctx,
+	status = dcerpc_samr_Connect2(conn->samr_pipe->binding_handle, mem_ctx,
 				      conn->samr_pipe->desthost,
 				      SEC_FLAG_MAXIMUM_ALLOWED,
-				      &conn->sam_connect_handle);
-	if (!NT_STATUS_IS_OK(result)) {
+				      &conn->sam_connect_handle,
+				      &result);
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(10,("cm_connect_sam: rpccli_samr_Connect2 failed "
 			  "for domain %s Error was %s\n",
-			  domain->name, nt_errstr(result) ));
+			  domain->name, nt_errstr(status) ));
+		goto done;
+	}
+	if (!NT_STATUS_IS_OK(result)) {
+		status = result;
+		DEBUG(10,("cm_connect_sam: dcerpc_samr_Connect2 failed "
+			  "for domain %s Error was %s\n",
+			  domain->name, nt_errstr(result)));
 		goto done;
 	}
 
  open_domain:
-	result = rpccli_samr_OpenDomain(conn->samr_pipe,
+	status = dcerpc_samr_OpenDomain(conn->samr_pipe->binding_handle,
 					mem_ctx,
 					&conn->sam_connect_handle,
 					SEC_FLAG_MAXIMUM_ALLOWED,
 					&domain->sid,
-					&conn->sam_domain_handle);
+					&conn->sam_domain_handle,
+					&result);
+	if (!NT_STATUS_IS_OK(status)) {
+		goto done;
+	}
 
+	status = result;
  done:
 
-	if (NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED)) {
+	if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
 		/*
 		 * if we got access denied, we might just have no access rights
 		 * to talk to the remote samr server server (e.g. when we are a
@@ -2316,17 +2341,17 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 		 */
 		TALLOC_FREE(conn->samr_pipe);
 		ZERO_STRUCT(conn->sam_domain_handle);
-		return result;
-	} else if (!NT_STATUS_IS_OK(result)) {
+		return status;
+	} else if (!NT_STATUS_IS_OK(status)) {
 		invalidate_cm_connection(conn);
-		return result;
+		return status;
 	}
 
 	*cli = conn->samr_pipe;
 	*sam_handle = conn->sam_domain_handle;
 	SAFE_FREE(machine_password);
 	SAFE_FREE(machine_account);
-	return result;
+	return status;
 }
 
 /**********************************************************************
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c
index dade76a..7cff38d 100644
--- a/source3/winbindd/winbindd_msrpc.c
+++ b/source3/winbindd/winbindd_msrpc.c
@@ -26,7 +26,7 @@
 #include "winbindd.h"
 #include "winbindd_rpc.h"
 
-#include "../librpc/gen_ndr/cli_samr.h"
+#include "../librpc/gen_ndr/ndr_samr_c.h"
 #include "rpc_client/cli_samr.h"
 #include "rpc_client/cli_lsarpc.h"
 #include "../libcli/security/security.h"
@@ -609,7 +609,7 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 				      char ***names,
 				      uint32_t **name_types)
 {
-        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+	NTSTATUS status, result;
         uint32 i, total_names = 0;
         struct policy_handle dom_pol, group_pol;
         uint32 des_access = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -619,6 +619,7 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 	struct rpc_pipe_client *cli;
 	unsigned int orig_timeout;
 	struct samr_RidAttrArray *rids = NULL;
+	struct dcerpc_binding_handle *b;
 
 	DEBUG(3,("msrpc_lookup_groupmem: %s sid=%s\n", domain->name,
 		  sid_string_dbg(group_sid)));
@@ -638,14 +639,20 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 	if (!NT_STATUS_IS_OK(result))
 		return result;
 
-        result = rpccli_samr_OpenGroup(cli, mem_ctx,
+	b = cli->binding_handle;
+
+	status = dcerpc_samr_OpenGroup(b, mem_ctx,
 				       &dom_pol,
 				       des_access,
 				       group_rid,
-				       &group_pol);
-
-        if (!NT_STATUS_IS_OK(result))
+				       &group_pol,
+				       &result);
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+	if (!NT_STATUS_IS_OK(result)) {
 		return result;
+	}
 
         /* Step #1: Get a list of user rids that are the members of the
            group. */
@@ -655,17 +662,26 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 
 	orig_timeout = rpccli_set_timeout(cli, 35000);
 
-        result = rpccli_samr_QueryGroupMember(cli, mem_ctx,
+	status = dcerpc_samr_QueryGroupMember(b, mem_ctx,
 					      &group_pol,
-					      &rids);
+					      &rids,
+					      &result);
 
 	/* And restore our original timeout. */
 	rpccli_set_timeout(cli, orig_timeout);
 
-	rpccli_samr_Close(cli, mem_ctx, &group_pol);
+	{
+		NTSTATUS _result;
+		dcerpc_samr_Close(b, mem_ctx, &group_pol, &_result);
+	}
+
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
 
-        if (!NT_STATUS_IS_OK(result))
+	if (!NT_STATUS_IS_OK(result)) {
 		return result;
+	}
 
 	if (!rids || !rids->count) {
 		names = NULL;
@@ -701,12 +717,16 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 
 		/* Lookup a chunk of rids */
 
-		result = rpccli_samr_LookupRids(cli, mem_ctx,
+		status = dcerpc_samr_LookupRids(b, mem_ctx,
 						&dom_pol,
 						num_lookup_rids,
 						&rid_mem[i],
 						&tmp_names,
-						&tmp_types);
+						&tmp_types,
+						&result);
+		if (!NT_STATUS_IS_OK(status)) {
+			return status;
+		}
 
 		/* see if we have a real error (and yes the
 		   STATUS_SOME_UNMAPPED is the one returned from 2k) */
@@ -945,10 +965,11 @@ static NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain,
 				     TALLOC_CTX *mem_ctx,
 				     struct samr_DomInfo12 *lockout_policy)
 {
-	NTSTATUS result;
+	NTSTATUS status, result;
 	struct rpc_pipe_client *cli;
 	struct policy_handle dom_pol;
 	union samr_DomainInfo *info = NULL;
+	struct dcerpc_binding_handle *b;
 
 	DEBUG(3, ("msrpc_lockout_policy: fetch lockout policy for %s\n", domain->name));
 
@@ -958,16 +979,23 @@ static NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain,
 		return NT_STATUS_NOT_SUPPORTED;
 	}
 
-	result = cm_connect_sam(domain, mem_ctx, &cli, &dom_pol);
-	if (!NT_STATUS_IS_OK(result)) {
+	status = cm_connect_sam(domain, mem_ctx, &cli, &dom_pol);
+	if (!NT_STATUS_IS_OK(status)) {
 		goto done;
 	}
 
-	result = rpccli_samr_QueryDomainInfo(cli, mem_ctx,
+	b = cli->binding_handle;
+
+	status = dcerpc_samr_QueryDomainInfo(b, mem_ctx,
 					     &dom_pol,
 					     12,
-					     &info);
+					     &info,
+					     &result);
+	if (!NT_STATUS_IS_OK(status)) {
+		goto done;
+	}
 	if (!NT_STATUS_IS_OK(result)) {
+		status = result;
 		goto done;
 	}
 
@@ -978,7 +1006,7 @@ static NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain,
 
   done:
 
-	return result;
+	return status;
 }
 
 /* find the password policy for a domain */
@@ -986,10 +1014,11 @@ static NTSTATUS msrpc_password_policy(struct winbindd_domain *domain,
 				      TALLOC_CTX *mem_ctx,
 				      struct samr_DomInfo1 *password_policy)
 {
-	NTSTATUS result;
+	NTSTATUS status, result;
 	struct rpc_pipe_client *cli;
 	struct policy_handle dom_pol;
 	union samr_DomainInfo *info = NULL;
+	struct dcerpc_binding_handle *b;
 
 	DEBUG(3, ("msrpc_password_policy: fetch password policy for %s\n",
 		  domain->name));
@@ -1000,15 +1029,21 @@ static NTSTATUS msrpc_password_policy(struct winbindd_domain *domain,
 		return NT_STATUS_NOT_SUPPORTED;
 	}
 
-	result = cm_connect_sam(domain, mem_ctx, &cli, &dom_pol);
-	if (!NT_STATUS_IS_OK(result)) {
+	status = cm_connect_sam(domain, mem_ctx, &cli, &dom_pol);
+	if (!NT_STATUS_IS_OK(status)) {
 		goto done;
 	}
 
-	result = rpccli_samr_QueryDomainInfo(cli, mem_ctx,
+	b = cli->binding_handle;
+
+	status = dcerpc_samr_QueryDomainInfo(b, mem_ctx,
 					     &dom_pol,
 					     1,
-					     &info);
+					     &info,
+					     &result);
+	if (!NT_STATUS_IS_OK(status)) {
+		goto done;
+	}
 	if (!NT_STATUS_IS_OK(result)) {
 		goto done;
 	}
@@ -1020,7 +1055,7 @@ static NTSTATUS msrpc_password_policy(struct winbindd_domain *domain,
 
   done:
 
-	return result;
+	return status;
 }
 
 typedef NTSTATUS (*lookup_sids_fn_t)(struct rpc_pipe_client *cli,
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 57a453e..760fa3b 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -25,7 +25,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "../libcli/auth/libcli_auth.h"
-#include "../librpc/gen_ndr/cli_samr.h"
+#include "../librpc/gen_ndr/ndr_samr_c.h"
 #include "rpc_client/cli_samr.h"
 #include "../librpc/gen_ndr/ndr_netlogon.h"
 #include "rpc_client/cli_netlogon.h"
@@ -1344,8 +1344,9 @@ static NTSTATUS winbindd_dual_pam_auth_samlogon(TALLOC_CTX *mem_ctx,
 		struct rpc_pipe_client *samr_pipe;
 		struct policy_handle samr_domain_handle, user_pol;
 		union samr_UserInfo *info = NULL;
-		NTSTATUS status_tmp;
+		NTSTATUS status_tmp, result_tmp;
 		uint32 acct_flags;
+		struct dcerpc_binding_handle *b;
 
 		status_tmp = cm_connect_sam(domain, mem_ctx,
 					    &samr_pipe, &samr_domain_handle);
@@ -1356,34 +1357,49 @@ static NTSTATUS winbindd_dual_pam_auth_samlogon(TALLOC_CTX *mem_ctx,
 			goto done;
 		}
 
-		status_tmp = rpccli_samr_OpenUser(samr_pipe, mem_ctx,
+		b = samr_pipe->binding_handle;
+
+		status_tmp = dcerpc_samr_OpenUser(b, mem_ctx,
 						  &samr_domain_handle,
 						  MAXIMUM_ALLOWED_ACCESS,
 						  my_info3->base.rid,
-						  &user_pol);
+						  &user_pol,
+						  &result_tmp);
 
 		if (!NT_STATUS_IS_OK(status_tmp)) {
 			DEBUG(3, ("could not open user handle on SAMR pipe: %s\n",
 				nt_errstr(status_tmp)));
 			goto done;
 		}
+		if (!NT_STATUS_IS_OK(result_tmp)) {
+			DEBUG(3, ("could not open user handle on SAMR pipe: %s\n",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list