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

Günther Deschner gd at samba.org
Wed Jul 30 15:10:57 GMT 2008


The branch, v3-2-test has been updated
       via  4f5255d1e5025c4c9ebb0b1f22d800e26bcdfb7f (commit)
      from  fba8506112938bf714c06da08e0e0725a7eecf3a (commit)

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


- Log -----------------------------------------------------------------
commit 4f5255d1e5025c4c9ebb0b1f22d800e26bcdfb7f
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jul 29 12:08:47 2008 +0200

    winbindd: handle trusted domains without sid.
    
    Guenther
    (cherry picked from commit 0c1efc6c89b1a51a94d10971bf0fc515416709b3)

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

Summary of changes:
 source/winbindd/winbindd_ads.c   |   12 ++++++++++--
 source/winbindd/winbindd_cache.c |    9 +++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd_ads.c b/source/winbindd/winbindd_ads.c
index 35ffe70..64b5ce7 100644
--- a/source/winbindd/winbindd_ads.c
+++ b/source/winbindd/winbindd_ads.c
@@ -1241,13 +1241,21 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
 			
 			(*names)[ret_count] = CONST_DISCARD(char *, trusts.array[i].netbios_name);
 			(*alt_names)[ret_count] = CONST_DISCARD(char *, trusts.array[i].dns_name);
-			sid_copy(&(*dom_sids)[ret_count], trusts.array[i].sid);
+			if (trusts.array[i].sid) {
+				sid_copy(&(*dom_sids)[ret_count], trusts.array[i].sid);
+			} else {
+				sid_copy(&(*dom_sids)[ret_count], &global_sid_NULL);
+			}
 
 			/* add to the trusted domain cache */
 
 			fstrcpy( d.name,  trusts.array[i].netbios_name);
 			fstrcpy( d.alt_name, trusts.array[i].dns_name);
-			sid_copy( &d.sid, trusts.array[i].sid);
+			if (trusts.array[i].sid) {
+				sid_copy( &d.sid, trusts.array[i].sid);
+			} else {
+				sid_copy(&(*dom_sids)[ret_count], &global_sid_NULL);
+			}
 
 			if ( domain->primary ) {
 				DEBUG(10,("trusted_domains(ads):  Searching "
diff --git a/source/winbindd/winbindd_cache.c b/source/winbindd/winbindd_cache.c
index dda8b03..3b2b9aa 100644
--- a/source/winbindd/winbindd_cache.c
+++ b/source/winbindd/winbindd_cache.c
@@ -2078,7 +2078,9 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
 	for (i=0; i<(*num_domains); i++) {
 		(*names)[i] = centry_string(centry, mem_ctx);
 		(*alt_names)[i] = centry_string(centry, mem_ctx);
-		centry_sid(centry, mem_ctx, &(*dom_sids)[i]);
+		if (!centry_sid(centry, mem_ctx, &(*dom_sids)[i])) {
+			sid_copy(&(*dom_sids)[i], &global_sid_NULL);
+		}
 	}
 
  	status = centry->status;
@@ -3549,8 +3551,11 @@ static bool add_wbdomain_to_tdc_array( struct winbindd_domain *new_dom,
 	list[idx].domain_name = talloc_strdup( list, new_dom->name );
 	list[idx].dns_name = talloc_strdup( list, new_dom->alt_name );
 
-	if ( !is_null_sid( &new_dom->sid ) )
+	if ( !is_null_sid( &new_dom->sid ) ) {
 		sid_copy( &list[idx].sid, &new_dom->sid );
+	} else {
+		sid_copy(&list[idx].sid, &global_sid_NULL);
+	}
 
 	if ( new_dom->domain_flags != 0x0 )
 		list[idx].trust_flags = new_dom->domain_flags;	


-- 
Samba Shared Repository


More information about the samba-cvs mailing list