diff options
author | Ken Raeburn <raeburn@mit.edu> | 2007-07-27 04:39:48 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2007-07-27 04:39:48 +0000 |
commit | 304539fc1dd57d93d68b98dc436fd8f84f5bdb75 (patch) | |
tree | 89275e5859315a64552496290301862c9aea554b | |
parent | 76fdc16a95093e399c43e8597275a5cc95ff4925 (diff) | |
download | krb5-304539fc1dd57d93d68b98dc436fd8f84f5bdb75.zip krb5-304539fc1dd57d93d68b98dc436fd8f84f5bdb75.tar.gz krb5-304539fc1dd57d93d68b98dc436fd8f84f5bdb75.tar.bz2 |
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
-rw-r--r-- | src/lib/krb5/keytab/kt_file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 1d58a53..400352d 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; } } |