[BACK]Return to auth-krb5.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/auth-krb5.c between version 1.12 and 1.12.2.1

version 1.12, 2003/08/28 12:54:34 version 1.12.2.1, 2004/02/28 03:51:32
Line 49 
Line 49 
 {  {
         Authctxt *authctxt = (Authctxt *)context;          Authctxt *authctxt = (Authctxt *)context;
         krb5_error_code problem;          krb5_error_code problem;
         static int cleanup_registered = 0;  
   
         if (authctxt->krb5_ctx == NULL) {          if (authctxt->krb5_ctx == NULL) {
                 problem = krb5_init_context(&authctxt->krb5_ctx);                  problem = krb5_init_context(&authctxt->krb5_ctx);
Line 57 
Line 56 
                         return (problem);                          return (problem);
                 krb5_init_ets(authctxt->krb5_ctx);                  krb5_init_ets(authctxt->krb5_ctx);
         }          }
         if (!cleanup_registered) {  
                 fatal_add_cleanup(krb5_cleanup_proc, authctxt);  
                 cleanup_registered = 1;  
         }  
         return (0);          return (0);
 }  }
   
Line 70 
Line 65 
         krb5_error_code problem;          krb5_error_code problem;
         krb5_ccache ccache = NULL;          krb5_ccache ccache = NULL;
   
         if (authctxt->pw == NULL)          if (!authctxt->valid)
                 return (0);                  return (0);
   
         temporarily_use_uid(authctxt->pw);          temporarily_use_uid(authctxt->pw);
Line 88 
Line 83 
         if (problem)          if (problem)
                 goto out;                  goto out;
   
         problem = krb5_cc_initialize(authctxt->krb5_ctx, ccache,          problem = krb5_cc_initialize(authctxt->krb5_ctx, ccache,
                 authctxt->krb5_user);                  authctxt->krb5_user);
         if (problem)          if (problem)
                 goto out;                  goto out;
Line 103 
Line 98 
         if (problem)          if (problem)
                 goto out;                  goto out;
   
         problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops,          problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops,
             &authctxt->krb5_fwd_ccache);              &authctxt->krb5_fwd_ccache);
         if (problem)          if (problem)
                 goto out;                  goto out;
Line 143 
Line 138 
 }  }
   
 void  void
 krb5_cleanup_proc(void *context)  krb5_cleanup_proc(Authctxt *authctxt)
 {  {
         Authctxt *authctxt = (Authctxt *)context;  
   
         debug("krb5_cleanup_proc called");          debug("krb5_cleanup_proc called");
         if (authctxt->krb5_fwd_ccache) {          if (authctxt->krb5_fwd_ccache) {
                 krb5_cc_destroy(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);                  krb5_cc_destroy(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.12.2.1