s3: ldap client can return NT_STATUS_OK when an error occurs in a paged search.
commit73186325be9c69e51d79f65e8682ac85e43dd9e6
authorDaniel Liberman <danielvl@gmail.com>
Wed, 22 Jan 2014 00:25:41 +0000 (21 16:25 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 10 Mar 2014 15:14:56 +0000 (10 16:14 +0100)
tree5b250de36fd678fd8ea1aac2678d508bc6d29cf6
parentad1dac1610c18d1e74d9dfc257cee49cb5552c1e
s3: ldap client can return NT_STATUS_OK when an error occurs in a paged search.

"Inside ads_do_search_all_args(), if the first call to ads_do_paged_search_args()
fails, the proper error status is returned.

But, if the execution is already inside the loop to get all the accounts doing
several calls to ads_do_paged_search_args(), and one of these calls times out,
the status returned is from the *first* call, so success. This causes
net_ads_search() to interpret the return from ads_do_search_retry() as
success and print all the accounts returned, but it’s only a subset."

Also ensure we free previously returned results on error
in subsequent fetches.

https://bugzilla.samba.org/show_bug.cgi?id=10387

Signed-off-by: Daniel Liberman <danielvl@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 23 01:40:54 CET 2014 on sn-devel-104

(cherry picked from commit b04e8b7557b82a4b96cf74db04742fb017edb3ba)
source3/libads/ldap.c