r23582: Fix event based krb5 ticket refreshing in winbindd.
authorGünther Deschner <gd@samba.org>
Fri, 22 Jun 2007 11:20:37 +0000 (11:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:32 +0000 (12:23 -0500)
We were incorrectly using the renew_till timestamp instead of the renewed
ticket's endtime to calculate the next refreshing date.

Guenther

source/include/includes.h
source/libsmb/clikrb5.c

index 3994d3b3c993470ecf9addc87fab5558b551599e..895cc58cece82edd1eae426060cacae99b738d2b 100644 (file)
@@ -1184,7 +1184,7 @@ BOOL smb_krb5_principal_compare_any_realm(krb5_context context,
 int cli_krb5_get_ticket(const char *principal, time_t time_offset, 
                        DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, const char *ccname, time_t *tgs_expire);
 PAC_LOGON_INFO *get_logon_info_from_pac(PAC_DATA *pac_data);
-krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *new_start_time);
+krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *expire_time);
 krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code);
 krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr);
 krb5_error_code smb_krb5_free_addresses(krb5_context context, smb_krb5_addresses *addr);
index a668d3b55cb2f16b73a88a40e75e2028944027fc..078706d1dbab58aa82c681e38bb83bda62153f78 100644 (file)
@@ -1134,7 +1134,7 @@ out:
  krb5_error_code smb_krb5_renew_ticket(const char *ccache_string,      /* FILE:/tmp/krb5cc_0 */
                                       const char *client_string,       /* gd@BER.SUSE.DE */
                                       const char *service_string,      /* krbtgt/BER.SUSE.DE@BER.SUSE.DE */
-                                      time_t *new_start_time)
+                                      time_t *expire_time)
 {
        krb5_error_code ret;
        krb5_context context = NULL;
@@ -1189,8 +1189,8 @@ out:
        
                ret = krb5_cc_store_cred(context, ccache, &creds);
 
-               if (new_start_time) {
-                       *new_start_time = (time_t) creds.times.renew_till;
+               if (expire_time) {
+                       *expire_time = (time_t) creds.times.endtime;
                }
 
                krb5_free_cred_contents(context, &creds);
@@ -1247,8 +1247,8 @@ out:
        
                ret = krb5_cc_store_cred(context, ccache, creds);
 
-               if (new_start_time) {
-                       *new_start_time = (time_t) creds->times.renew_till;
+               if (expire_time) {
+                       *expire_time = (time_t) creds->times.endtime;
                }
                                                
                krb5_free_cred_contents(context, &creds_in);