[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1702-g3a3c1ae

Günther Deschner gd at samba.org
Tue Jan 29 14:18:41 GMT 2008


The branch, v3-2-test has been updated
       via  3a3c1aed9bfc681457aa06f706fc6fe2d9b2e903 (commit)
      from  c832882e49ff0dac6a717819dda24ab814253b2f (commit)

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


- Log -----------------------------------------------------------------
commit 3a3c1aed9bfc681457aa06f706fc6fe2d9b2e903
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 29 14:20:20 2008 +0100

    Use pidl generated call to enumerate ds trusted domains in winbindd.
    
    Guenther

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

Summary of changes:
 source/winbindd/winbindd_cm.c |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index 9491007..c22022d 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -1716,8 +1716,7 @@ static bool set_dc_type_and_flags_trustinfo( struct winbindd_domain *domain )
 {
 	struct winbindd_domain *our_domain;
 	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-	struct ds_domain_trust *domains = NULL;
-	int count = 0;
+	struct netr_DomainTrustList trusts;
 	int i;
 	uint32 flags = (DS_DOMAIN_IN_FOREST | 
 			DS_DOMAIN_DIRECT_OUTBOUND | 
@@ -1763,19 +1762,27 @@ static bool set_dc_type_and_flags_trustinfo( struct winbindd_domain *domain )
 		return False;
 	}	
 
-	result = rpccli_ds_enum_domain_trusts(cli, mem_ctx,
-					      cli->cli->desthost, 
-					      flags, &domains,
-					      (unsigned int *)&count);
+	result = rpccli_netr_DsrEnumerateDomainTrusts(cli, mem_ctx,
+						      cli->cli->desthost,
+						      flags,
+						      &trusts,
+						      NULL);
+	if (!NT_STATUS_IS_OK(result)) {
+		DEBUG(0,("set_dc_type_and_flags_trustinfo: "
+			"failed to query trusted domain list: %s\n",
+			nt_errstr(result)));
+		talloc_destroy(mem_ctx);
+		return false;
+	}
 
 	/* Now find the domain name and get the flags */
 
-	for ( i=0; i<count; i++ ) {
-		if ( strequal( domain->name, domains[i].netbios_domain ) ) {			
-			domain->domain_flags          = domains[i].flags;
-			domain->domain_type           = domains[i].trust_type;
-			domain->domain_trust_attribs  = domains[i].trust_attributes;
-						
+	for ( i=0; i<trusts.count; i++ ) {
+		if ( strequal( domain->name, trusts.array[i].netbios_name) ) {
+			domain->domain_flags          = trusts.array[i].trust_flags;
+			domain->domain_type           = trusts.array[i].trust_type;
+			domain->domain_trust_attribs  = trusts.array[i].trust_attributes;
+
 			if ( domain->domain_type == DS_DOMAIN_TRUST_TYPE_UPLEVEL )
 				domain->active_directory = True;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list