[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1779-g3111d78

Michael Adam obnox at samba.org
Mon May 25 12:57:45 GMT 2009


The branch, master has been updated
       via  3111d78001f458cfcaf81123a1d1c23d5927a6c2 (commit)
       via  35c3f4162d15f9846a645444e623178b78c52994 (commit)
      from  fca7dce1a908570e463ddcbd663955fcafd1d843 (commit)

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


- Log -----------------------------------------------------------------
commit 3111d78001f458cfcaf81123a1d1c23d5927a6c2
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

commit 35c3f4162d15f9846a645444e623178b78c52994
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

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

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