summaryrefslogtreecommitdiff
path: root/source/nsswitch/winbindd_ads.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/nsswitch/winbindd_ads.c')
-rw-r--r--source/nsswitch/winbindd_ads.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/nsswitch/winbindd_ads.c b/source/nsswitch/winbindd_ads.c
index 7f9d2eb4e52..84e8ab3fc32 100644
--- a/source/nsswitch/winbindd_ads.c
+++ b/source/nsswitch/winbindd_ads.c
@@ -93,11 +93,17 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
{
ADS_STRUCT *ads;
int rc;
+ char *ccache;
if (domain->private) {
return (ADS_STRUCT *)domain->private;
}
+ /* we don't want this to affect the users ccache */
+ ccache = lock_path("winbindd_ccache");
+ setenv("KRB5CCNAME", ccache, 1);
+ unlink(ccache);
+
ads = ads_init(NULL, NULL, NULL, NULL);
if (!ads) {
DEBUG(1,("ads_init for domain %s failed\n", domain->name));
@@ -154,6 +160,8 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
void *msg = NULL;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+ *num_entries = 0;
+
DEBUG(3,("ads: query_user_list\n"));
if ((*start_ndx) != 0) {
@@ -245,6 +253,8 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
void *msg = NULL;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+ *num_entries = 0;
+
DEBUG(3,("ads: enum_dom_groups\n"));
if ((*start_ndx) != 0) {
@@ -514,6 +524,8 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
char *sidstr;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+ *num_groups = 0;
+
DEBUG(3,("ads: lookup_usergroups\n"));
(*num_groups) = 0;