summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_ad.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@us.ibm.com>2013-02-21 12:31:28 -0700
committerAndrew Bartlett <abartlet@samba.org>2013-03-09 06:30:22 +0100
commit0c4e467c1cc661552bfd6745825e2106ec8279d7 (patch)
treef2b475fa8aa54f01e3da0441efb21f813067c339 /source3/winbindd/idmap_ad.c
parentc07c167edb71568ab18f016346e60803d1195d42 (diff)
downloadsamba-0c4e467c1cc661552bfd6745825e2106ec8279d7.tar.gz
samba-0c4e467c1cc661552bfd6745825e2106ec8279d7.tar.bz2
samba-0c4e467c1cc661552bfd6745825e2106ec8279d7.zip
s3-winbindd: Move code for verifying ADS connection to common helper function
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/winbindd/idmap_ad.c')
-rw-r--r--source3/winbindd/idmap_ad.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index d6f31ba6e9..0e00a340bf 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -39,8 +39,6 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
-#define WINBIND_CCACHE_NAME "MEMORY:winbind_ccache"
-
#define CHECK_ALLOC_DONE(mem) do { \
if (!mem) { \
DEBUG(0, ("Out of memory!\n")); \
@@ -74,29 +72,9 @@ static ADS_STATUS ad_idmap_cached_connection_internal(struct idmap_domain *dom)
ctx = talloc_get_type(dom->private_data, struct idmap_ad_context);
+ ads_cached_connection_reuse(&ctx->ads);
if (ctx->ads != NULL) {
-
- time_t expire;
- time_t now = time(NULL);
-
- ads = ctx->ads;
-
- expire = MIN(ads->auth.tgt_expire, ads->auth.tgs_expire);
-
- /* check for a valid structure */
- DEBUG(7, ("Current tickets expire in %d seconds (at %d, time is now %d)\n",
- (uint32)expire-(uint32)now, (uint32) expire, (uint32) now));
-
- if ( ads->config.realm && (expire > time(NULL))) {
- return ADS_SUCCESS;
- } else {
- /* we own this ADS_STRUCT so make sure it goes away */
- DEBUG(7,("Deleting expired krb5 credential cache\n"));
- ads->is_mine = True;
- ads_destroy( &ads );
- ads_kdestroy(WINBIND_CCACHE_NAME);
- ctx->ads = NULL;
- }
+ return ADS_SUCCESS;
}
/* we don't want this to affect the users ccache */