idmap_rfc2307: "ldap_next_entry" needs the previous entry, not the start
authorVolker Lendecke <vl@samba.org>
Fri, 31 Mar 2017 15:23:39 +0000 (15:23 +0000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 12 May 2017 06:54:19 +0000 (08:54 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12757

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 17563f295ffa7379daa5bf7cc89540df4ae4f7b3)

source3/winbindd/idmap_rfc2307.c

index fcb950d4538b42d871edd01acd3227a8e3078d2c..1102790d5a9ec44bb04c6d89771f1ad2327e4104 100644 (file)
@@ -553,7 +553,7 @@ static void idmap_rfc2307_map_xid_results(struct idmap_rfc2307_context *ctx,
                if (i == 0) {
                        entry = ldap_first_entry(ctx->ldap, result);
                } else {
-                       entry = ldap_next_entry(ctx->ldap, result);
+                       entry = ldap_next_entry(ctx->ldap, entry);
                }
                if (!entry) {
                        DEBUG(2, ("Unable to fetch entry.\n"));