[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-1064-g5328f60

Michael Adam obnox at samba.org
Mon May 25 13:22:05 GMT 2009


The branch, v3-4-test has been updated
       via  5328f600bbc6535d8880b1b0c74bcfbd9b7a162a (commit)
       via  751b6b07c5ea25809b1766a01fc859d580304ae9 (commit)
      from  69907810fee3253096958bf174a052d3cb3b385c (commit)

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


- Log -----------------------------------------------------------------
commit 5328f600bbc6535d8880b1b0c74bcfbd9b7a162a
Author: Michael Adam <obnox at samba.org>
Date:   Mon May 25 11:54:43 2009 +0200

    s3:winbind:idmap_ldap: warn about duplicate SID->XID mappings (bug #6387)
    
    With the current infrastructure, we should not return error on
    duplicate mappings but just warn instead (because an error would
    trigger the attempt to create yet another mapping).
    
    Michael
    (cherry picked from commit 3111d78001f458cfcaf81123a1d1c23d5927a6c2)

commit 751b6b07c5ea25809b1766a01fc859d580304ae9
Author: Michael Adam <obnox at samba.org>
Date:   Mon May 25 11:29:14 2009 +0200

    s3:winbind:idmap_ldap: warn about duplicate XID->SID mappings (bug #6387)
    
    With the current infrastructure, we should not return error on
    duplicate mappings but just warn instead (because an error would
    trigger the attempt to create yet another mapping).
    
    Michael
    (cherry picked from commit 35c3f4162d15f9846a645444e623178b78c52994)

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

Summary of changes:
 source3/winbindd/idmap_ldap.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 854fd21..88ece8c 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -1055,6 +1055,14 @@ again:
 			TALLOC_FREE(sidstr);
 			continue;
 		}
+
+		if (map->status == ID_MAPPED) {
+			DEBUG(1, ("WARNING: duplicate %s mapping in LDAP. "
+			      "overwriting mapping %u -> %s with %u -> %s\n",
+			      (type == ID_TYPE_UID) ? "UID" : "GID",
+			      id, sid_string_dbg(map->sid), id, sidstr));
+		}
+
 		TALLOC_FREE(sidstr);
 
 		/* mapped */
@@ -1249,8 +1257,6 @@ again:
 			continue;
 		}
 
-		TALLOC_FREE(sidstr);
-
 		/* now try to see if it is a uid, if not try with a gid
 		 * (gid is more common, but in case both uidNumber and
 		 * gidNumber are returned the SID is mapped to the uid
@@ -1268,6 +1274,7 @@ again:
 		if ( ! tmp) { /* no ids ?? */
 			DEBUG(5, ("no uidNumber, "
 				  "nor gidNumber attributes found\n"));
+			TALLOC_FREE(sidstr);
 			continue;
 		}
 
@@ -1278,11 +1285,21 @@ again:
 			DEBUG(5, ("Requested id (%u) out of range (%u - %u). "
 				  "Filtered!\n", id,
 				  ctx->filter_low_id, ctx->filter_high_id));
+			TALLOC_FREE(sidstr);
 			TALLOC_FREE(tmp);
 			continue;
 		}
 		TALLOC_FREE(tmp);
 
+		if (map->status == ID_MAPPED) {
+			DEBUG(1, ("WARNING: duplicate %s mapping in LDAP. "
+			      "overwriting mapping %s -> %u with %s -> %u\n",
+			      (type == ID_TYPE_UID) ? "UID" : "GID",
+			      sidstr, map->xid.id, sidstr, id));
+		}
+
+		TALLOC_FREE(sidstr);
+
 		/* mapped */
 		map->xid.type = type;
 		map->xid.id = id;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list