s3:winbind:idmap_ldap: warn about duplicate XID->SID mappings (bug #6387)
authorMichael Adam <obnox@samba.org>
Mon, 25 May 2009 09:29:14 +0000 (11:29 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 25 May 2009 13:21:18 +0000 (15:21 +0200)
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)

source3/winbindd/idmap_ldap.c

index 854fd21df8ef918f0caf7ba0b2a88b29de925a8d..63108040fd0b633d9de4e783ac24f0721c3c0d86 100644 (file)
@@ -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 */