diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-02-19 11:33:35 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-02-19 11:33:35 +0000 |
commit | 50bced1e26434ecc7474964062746e2831e5f433 (patch) | |
tree | a98a2a768dd5938e941ed6c2ab2a153dee4a3416 /source/nsswitch | |
parent | 4fe8066394143c64c79c052c00f0d747e872103a (diff) | |
download | samba-50bced1e26434ecc7474964062746e2831e5f433.tar.gz samba-50bced1e26434ecc7474964062746e2831e5f433.tar.xz samba-50bced1e26434ecc7474964062746e2831e5f433.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
Diffstat (limited to 'source/nsswitch')
-rw-r--r-- | source/nsswitch/winbindd.h | 14 | ||||
-rw-r--r-- | source/nsswitch/winbindd_ads.c | 4 |
2 files changed, 1 insertions, 17 deletions
diff --git a/source/nsswitch/winbindd.h b/source/nsswitch/winbindd.h index e8bcf76bd3b..164b7ffda75 100644 --- a/source/nsswitch/winbindd.h +++ b/source/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/source/nsswitch/winbindd_ads.c b/source/nsswitch/winbindd_ads.c index 7cea4aa716e..be4ed1c667f 100644 --- a/source/nsswitch/winbindd_ads.c +++ b/source/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) { |