summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-05-25 11:54:43 +0200
committerKarolin Seeger <kseeger@samba.org>2009-05-26 09:39:53 +0200
commited33008c2b85e46957c2b26ae953198b425343dd (patch)
tree93f5741439391c87e7aa0916c92f5539070eb231
parenta6443f9d46eccc48f0e5bd1db46868321a337325 (diff)
downloadsamba-ed33008c2b85e46957c2b26ae953198b425343dd.tar.gz
samba-ed33008c2b85e46957c2b26ae953198b425343dd.tar.xz
samba-ed33008c2b85e46957c2b26ae953198b425343dd.zip
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) (cherry picked from commit 5328f600bbc6535d8880b1b0c74bcfbd9b7a162a)
-rw-r--r--source3/winbindd/idmap_ldap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 63108040fd0..88ece8c7de4 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -1257,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
@@ -1276,6 +1274,7 @@ again:
if ( ! tmp) { /* no ids ?? */
DEBUG(5, ("no uidNumber, "
"nor gidNumber attributes found\n"));
+ TALLOC_FREE(sidstr);
continue;
}
@@ -1286,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;