summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-19 11:33:35 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-19 11:33:35 +0000
commit1f1125577c000ab72754af00cd83c57fadcc85f1 (patch)
tree1ff613b18e432bb53dd8d93276ecbd91f5d1b85f /source3/nsswitch
parent231f7375590110046ed67b7b337ac2e12d257736 (diff)
downloadsamba-1f1125577c000ab72754af00cd83c57fadcc85f1.tar.gz
samba-1f1125577c000ab72754af00cd83c57fadcc85f1.tar.bz2
samba-1f1125577c000ab72754af00cd83c57fadcc85f1.zip
Move to a in-memory ccache for winbind, and replace setenv() properly.
(According to the manpages, you cannot put a stack variable into putenv()). Yes, this leaks memory. Andrew Bartlett (This used to be commit 50bced1e26434ecc7474964062746e2831e5f433)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd.h14
-rw-r--r--source3/nsswitch/winbindd_ads.c4
2 files changed, 1 insertions, 17 deletions
diff --git a/source3/nsswitch/winbindd.h b/source3/nsswitch/winbindd.h
index e8bcf76bd3..164b7ffda7 100644
--- a/source3/nsswitch/winbindd.h
+++ b/source3/nsswitch/winbindd.h
@@ -205,18 +205,4 @@ typedef struct {
#define DOM_SEQUENCE_NONE ((uint32)-1)
-/* SETENV */
-#if HAVE_SETENV
-#define SETENV(name, value, overwrite) setenv(name,value,overwrite)
-#elif HAVE_PUTENV
-#define SETENV(name, value, overwrite) \
-{ \
- fstring envvar; \
- slprintf(envvar, sizeof(fstring), "%s=%s", name, value); \
- putenv(envvar); \
-}
-#else
-#define SETENV(name, value, overwrite) ;
-#endif
-
#endif /* _WINBINDD_H */
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 7cea4aa716..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) {