summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-05-22 11:58:00 +0200
committerKarolin Seeger <kseeger@samba.org>2009-08-11 12:05:55 +0200
commit15652ee4259201a6d794c735d7e81631338f1050 (patch)
tree6ae62fe318dcc9c0a6582eaf6a8dd8c0279e896f
parenta49a3bdc1aa0c66edc00e11b470a3c3ccca79f6d (diff)
downloadsamba-15652ee4259201a6d794c735d7e81631338f1050.tar.gz
samba-15652ee4259201a6d794c735d7e81631338f1050.tar.xz
samba-15652ee4259201a6d794c735d7e81631338f1050.zip
s3:winbind:idmap_ldap: fix a crash bug in idmap_ldap_unixids_to_sids (#6387)
This fixes a crash bug hit when multiple mappings were found by the ldap search. This crash was caused by an ldap asssertion in ldap_next_entry because was set to NULL in each iteration. The corresponding fix was applied to the idmap_ldap_sids_to_unixids() by Jerry in 2007 (b066668b74768d9ed547f16bf7b6ba6aea5df20a). This fixes the crash part of bug #6387. There is a logic part, too: The problem currently only occurs when multiple mappings are found for one given unixid. Now winbindd does not crash any more but it does not correctly handle this situation. It just returns the last mapping from the ldap search results. This needs fixing. Michael (cherry picked from commit e9010fa366746ec1ae948dbcf3493d446e23b14c) Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r--source/winbindd/idmap_ldap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/winbindd/idmap_ldap.c b/source/winbindd/idmap_ldap.c
index 53f63103b1d..d4bf65bb58e 100644
--- a/source/winbindd/idmap_ldap.c
+++ b/source/winbindd/idmap_ldap.c
@@ -893,6 +893,7 @@ static NTSTATUS idmap_ldap_unixids_to_sids(struct idmap_domain *dom,
TALLOC_CTX *memctx;
struct idmap_ldap_context *ctx;
LDAPMessage *result = NULL;
+ LDAPMessage *entry = NULL;
const char *uidNumber;
const char *gidNumber;
const char **attr_list;
@@ -988,7 +989,6 @@ again:
}
for (i = 0; i < count; i++) {
- LDAPMessage *entry = NULL;
char *sidstr = NULL;
char *tmp = NULL;
enum id_type type;