[SCM] Samba Shared Repository - branch master updated

Jim McDonough jmcd at samba.org
Fri Dec 7 14:39:02 MST 2012


The branch, master has been updated
       via  df0f59f winbind: Make the code more readable in trustdom_list_done().
      from  16d725b Fix bug #9471 - SEGV when using second vfs module.

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


- Log -----------------------------------------------------------------
commit df0f59f66cca61eee967e89dc659af4ba33f0e6f
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 6 14:31:45 2012 +0100

    winbind: Make the code more readable in trustdom_list_done().
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jim McDonough <jmcd at samba.org>
    
    Autobuild-User(master): Jim McDonough <jmcd at samba.org>
    Autobuild-Date(master): Fri Dec  7 22:38:43 CET 2012 on sn-devel-104

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

Summary of changes:
 source3/winbindd/winbindd_util.c |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 6e13ca8..c32feb8 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -303,6 +303,7 @@ static void trustdom_list_done(struct tevent_req *req)
 		struct dom_sid sid;
 		struct winbindd_domain *domain;
 		char *alternate_name = NULL;
+		bool domain_exists;
 
 		alt_name = strchr(p, '\\');
 		if (alt_name == NULL) {
@@ -336,22 +337,25 @@ static void trustdom_list_done(struct tevent_req *req)
 		if ( !strequal( alt_name, "(null)" ) )
 			alternate_name = alt_name;
 
-		/* If we have an existing domain structure, calling
- 		   add_trusted_domain() will update the SID if
- 		   necessary.  This is important because we need the
- 		   SID for sibling domains */
+		/* Check if we already have a child for the domain */
+		domain_exists = (find_domain_from_name_noinit(p) != NULL);
 
-		if ( find_domain_from_name_noinit(p) != NULL ) {
-			domain = add_trusted_domain(p, alternate_name,
-						    &cache_methods,
-						    &sid);
-		} else {
-			domain = add_trusted_domain(p, alternate_name,
-						    &cache_methods,
-						    &sid);
-			if (domain) {
-				setup_domain_child(domain);
-			}
+		/*
+		 * We always call add_trusted_domain() cause on an existing
+		 * domain structure, it will update the SID if necessary.
+		 * This is important because we need the SID for sibling
+		 * domains.
+		 */
+		domain = add_trusted_domain(p, alternate_name,
+					    &cache_methods,
+					    &sid);
+
+		/*
+		 * If the domain doesn't exist yet and got correctly added,
+		 * setup a new domain child.
+		 */
+		if (!domain_exists && domain != NULL) {
+			setup_domain_child(domain);
 		}
 		p=q;
 		if (p != NULL)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list