summaryrefslogtreecommitdiffstats
path: root/source/nsswitch/winbindd_cred_cache.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-03-01 04:35:31 +0000
committerGerald Carter <jerry@samba.org>2007-03-01 04:35:31 +0000
commit03984b463596cd654bef952d024b96252909c7c7 (patch)
tree0a278d3c6c5f7cc395772bebc39c8930c134805c /source/nsswitch/winbindd_cred_cache.c
parentfec07a7bb897b3c3723d5cb047daa86b45e5e9fd (diff)
downloadsamba-03984b463596cd654bef952d024b96252909c7c7.tar.gz
samba-03984b463596cd654bef952d024b96252909c7c7.tar.xz
samba-03984b463596cd654bef952d024b96252909c7c7.zip
r21619: * Pickup latest changes from SAMBA_3_0_25 (this will be it
for 3.0.25pre1 unless something blows up) * Update release notes some more
Diffstat (limited to 'source/nsswitch/winbindd_cred_cache.c')
-rw-r--r--source/nsswitch/winbindd_cred_cache.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/nsswitch/winbindd_cred_cache.c b/source/nsswitch/winbindd_cred_cache.c
index 0847ac9e271..600409420ae 100644
--- a/source/nsswitch/winbindd_cred_cache.c
+++ b/source/nsswitch/winbindd_cred_cache.c
@@ -215,7 +215,8 @@ static void krb5_ticket_gain_handler(struct event_context *event_ctx,
DEBUG(10,("krb5_ticket_gain_handler: successful kinit for: %s in ccache: %s\n",
entry->principal_name, entry->ccname));
- new_start = entry->refresh_time;
+ /* Renew at 1/2 the expiration time */
+ new_start = entry->refresh_time / 2;
goto got_ticket;
}
@@ -369,8 +370,9 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
krb5_ticket_gain_handler,
entry);
} else {
+ /* Renew at 1/2 the ticket expiration time */
entry->event = event_add_timed(winbind_event_context(), entry,
- timeval_set((ticket_end - 1), 0),
+ timeval_set((ticket_end - 1)/2, 0),
"krb5_ticket_refresh_handler",
krb5_ticket_refresh_handler,
entry);
@@ -494,6 +496,17 @@ static NTSTATUS store_memory_creds(struct WINBINDD_MEMORY_CREDS *memcredp, const
memcredp->len += strlen(pass)+1;
}
+#if defined(LINUX)
+ /* aligning the memory on on x86_64 and compiling
+ with gcc 4.1 using -O2 causes a segv in the
+ next memset() --jerry */
+ memcredp->nt_hash = SMB_MALLOC_ARRAY(unsigned char, memcredp->len);
+#else
+ /* On non-linux platforms, mlock()'d memory must be aligned */
+ memcredp->nt_hash = SMB_MEMALIGN_ARRAY(unsigned char,
+ getpagesize(), memcredp->len);
+#endif
+
/* On non-linux platforms, mlock()'d memory must be aligned */
memcredp->nt_hash = SMB_MEMALIGN_ARRAY(unsigned char, psize,