summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-02-19 22:50:05 +0000
committerTim Potter <tpot@samba.org>2003-02-19 22:50:05 +0000
commitfe2f9f813df43a3d7313cc4d54e71ed3b1a04b02 (patch)
tree1b577ead440d4c18e9e2e45abb209b4162e99828
parent5ef421f1d820abee603817f91a5656b26ae502c2 (diff)
downloadsamba-fe2f9f813df43a3d7313cc4d54e71ed3b1a04b02.tar.gz
samba-fe2f9f813df43a3d7313cc4d54e71ed3b1a04b02.tar.bz2
samba-fe2f9f813df43a3d7313cc4d54e71ed3b1a04b02.zip
Merge some random looking setenv related kerberos stuff that makes
winbindd build again. (This used to be commit c4f46890fe7f0dc16520cd5ed0fd06dcd7682703)
-rw-r--r--source3/nsswitch/winbindd_ads.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 261c2f2237..be4ed1c667 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -46,9 +46,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
}
/* we don't want this to affect the users ccache */
- ccache = lock_path("winbindd_ccache");
- SETENV("KRB5CCNAME", ccache, 1);
- unlink(ccache);
+ setenv("KRB5CCNAME", "MEMORY:winbind_ccache", 1);
ads = ads_init(domain->alt_name, domain->name, NULL);
if (!ads) {
@@ -346,10 +344,17 @@ static BOOL dn_lookup(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
ADS_STATUS rc;
uint32 atype;
DOM_SID sid;
+ char *escaped_dn = escape_ldap_string_alloc(dn);
+
+ if (!escaped_dn) {
+ return False;
+ }
asprintf(&exp, "(distinguishedName=%s)", dn);
rc = ads_search_retry(ads, &res, exp, attrs);
- free(exp);
+ SAFE_FREE(exp);
+ SAFE_FREE(escaped_dn);
+
if (!ADS_ERR_OK(rc)) {
goto failed;
}