From fa8cbe088d757fbb28a9411b84b37dfa62f94dba Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sun, 25 Feb 1996 00:17:39 +0000 Subject: [PATCH] For MS-DOS filesystems, you must close the file before unlinking it, otherwise the unlink() will fail. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7531 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/file/ChangeLog | 6 ++++++ src/lib/krb5/ccache/file/fcc_destry.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog index af8e13c20..08f7b28d3 100644 --- a/src/lib/krb5/ccache/file/ChangeLog +++ b/src/lib/krb5/ccache/file/ChangeLog @@ -1,3 +1,9 @@ +Sat Feb 24 19:16:23 1996 Theodore Y. Ts'o + + * fcc_destry.c (krb5_fcc_destroy): For MS-DOS filesystems, you + must close the file before unlinking it, otherwise the + unlink() will fail. + Thu Feb 15 14:55:56 1996 Ezra Peisach * fcc_skip.c (krb5_fcc_skip_header): If version is not FVNO_4, do not diff --git a/src/lib/krb5/ccache/file/fcc_destry.c b/src/lib/krb5/ccache/file/fcc_destry.c index f160c6811..02deb7293 100644 --- a/src/lib/krb5/ccache/file/fcc_destry.c +++ b/src/lib/krb5/ccache/file/fcc_destry.c @@ -84,14 +84,14 @@ krb5_fcc_destroy(context, id) size -= i; /* We've read this much */ } + if (OPENCLOSE(id)) { + (void) close(((krb5_fcc_data *)id->data)->fd); + ((krb5_fcc_data *) id->data)->fd = -1; + } + ret = unlink(((krb5_fcc_data *) id->data)->filename); if (ret < 0) { kret = krb5_fcc_interpret(context, errno); - if (OPENCLOSE(id)) { - (void) close(((krb5_fcc_data *)id->data)->fd); - ((krb5_fcc_data *) id->data)->fd = -1; - kret = ret; - } goto cleanup; } -- 2.26.2