Set KTFILEP field to null any time we close the file
authorKen Raeburn <raeburn@mit.edu>
Fri, 27 Jul 2007 04:39:48 +0000 (04:39 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 27 Jul 2007 04:39:48 +0000 (04:39 +0000)
ticket: 3099
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19739 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/kt_file.c

index 1d58a53eeed8919c9e27b47640cc63715889c4c8..400352d02eba8054e914a50c4e5537a720079536 100644 (file)
@@ -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;
        }
     }