=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth-krb5.c,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -u -r1.10.2.1 -r1.10.2.2 --- src/usr.bin/ssh/auth-krb5.c 2003/09/16 20:50:42 1.10.2.1 +++ src/usr.bin/ssh/auth-krb5.c 2004/03/04 18:18:15 1.10.2.2 @@ -28,7 +28,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-krb5.c,v 1.10.2.1 2003/09/16 20:50:42 brad Exp $"); +RCSID("$OpenBSD: auth-krb5.c,v 1.10.2.2 2004/03/04 18:18:15 brad Exp $"); #include "ssh.h" #include "ssh1.h" @@ -49,7 +49,6 @@ { Authctxt *authctxt = (Authctxt *)context; krb5_error_code problem; - static int cleanup_registered = 0; if (authctxt->krb5_ctx == NULL) { problem = krb5_init_context(&authctxt->krb5_ctx); @@ -57,10 +56,6 @@ return (problem); krb5_init_ets(authctxt->krb5_ctx); } - if (!cleanup_registered) { - fatal_add_cleanup(krb5_cleanup_proc, authctxt); - cleanup_registered = 1; - } return (0); } @@ -70,7 +65,7 @@ krb5_error_code problem; krb5_ccache ccache = NULL; - if (authctxt->pw == NULL) + if (!authctxt->valid) return (0); temporarily_use_uid(authctxt->pw); @@ -88,7 +83,7 @@ if (problem) goto out; - problem = krb5_cc_initialize(authctxt->krb5_ctx, ccache, + problem = krb5_cc_initialize(authctxt->krb5_ctx, ccache, authctxt->krb5_user); if (problem) goto out; @@ -103,7 +98,7 @@ if (problem) 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); if (problem) goto out; @@ -143,10 +138,8 @@ } void -krb5_cleanup_proc(void *context) +krb5_cleanup_proc(Authctxt *authctxt) { - Authctxt *authctxt = (Authctxt *)context; - debug("krb5_cleanup_proc called"); if (authctxt->krb5_fwd_ccache) { krb5_cc_destroy(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);