From: Ken Raeburn Date: Fri, 27 Jul 2007 04:39:48 +0000 (+0000) Subject: Set KTFILEP field to null any time we close the file X-Git-Tag: krb5-1.7-alpha1~986 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=304539fc1dd57d93d68b98dc436fd8f84f5bdb75;p=krb5.git Set KTFILEP field to null any time we close the file ticket: 3099 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19739 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 1d58a53ee..400352d02 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -1105,6 +1105,7 @@ krb5_ktfileint_open(krb5_context context, krb5_keytab id, int mode) kerror = errno; (void) krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); + KTFILEP(id) = 0; return kerror; } } else { @@ -1116,6 +1117,7 @@ krb5_ktfileint_open(krb5_context context, krb5_keytab id, int mode) kerror = errno; (void) krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); + KTFILEP(id) = 0; return kerror; } kt_vno = KTVERSION(id) = ntohs(kt_vno); @@ -1123,6 +1125,7 @@ krb5_ktfileint_open(krb5_context context, krb5_keytab id, int mode) (kt_vno != KRB5_KT_VNO_1)) { (void) krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); + KTFILEP(id) = 0; return KRB5_KEYTAB_BADVNO; } }