summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-10 22:10:16 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-10 22:10:16 +0000
commit273deacb32325369bcaebab384fe6072b0893959 (patch)
treebdda5a4e0093b786f1a971fa9c7ca965c650d632 /source3/nsswitch
parenta427fafc1f95d472189e867781a4b75ab0c8adcb (diff)
downloadsamba-273deacb32325369bcaebab384fe6072b0893959.tar.gz
samba-273deacb32325369bcaebab384fe6072b0893959.tar.bz2
samba-273deacb32325369bcaebab384fe6072b0893959.zip
robustness fixes and moved ccache location into winbindd_ads code
(This used to be commit 24aa09ff3dd128c6f12b4cb072943ff668a29a67)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_ads.c12
-rw-r--r--source3/nsswitch/winbindd_rpc.c8
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 7f9d2eb4e5..84e8ab3fc3 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/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;
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c
index cc1d3b5457..5417e8c4d0 100644
--- a/source3/nsswitch/winbindd_rpc.c
+++ b/source3/nsswitch/winbindd_rpc.c
@@ -40,6 +40,8 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
SAM_DISPINFO_1 info1;
int i;
+ *num_entries = 0;
+
/* Get sam handle */
if (!(hnd = cm_get_sam_handle(domain->name)))
@@ -255,6 +257,8 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
DOM_GID *user_groups;
int i;
+ *num_groups = 0;
+
/* Get sam handle */
if (!(hnd = cm_get_sam_handle(domain->name)))
goto done;
@@ -315,6 +319,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
BOOL got_dom_pol = False, got_group_pol = False;
+ *num_names = 0;
+
/* Get sam handle */
if (!(hnd = cm_get_sam_handle(domain->name)))
@@ -471,6 +477,8 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 enum_ctx = 0;
+ *num_domains = 0;
+
if (!(hnd = cm_get_lsa_handle(lp_workgroup())))
goto done;