For MS-DOS filesystems, you must close the file before unlinking it,
authorTheodore Tso <tytso@mit.edu>
Sun, 25 Feb 1996 00:17:39 +0000 (00:17 +0000)
committerTheodore Tso <tytso@mit.edu>
Sun, 25 Feb 1996 00:17:39 +0000 (00:17 +0000)
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
src/lib/krb5/ccache/file/fcc_destry.c

index af8e13c20c32db58a5369e5eb858da758878b8fd..08f7b28d344a2969623cffdf7fb83ec92a965ac2 100644 (file)
@@ -1,3 +1,9 @@
+Sat Feb 24 19:16:23 1996  Theodore Y. Ts'o  <tytso@dcl>
+
+       * 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  <epeisach@kangaroo.mit.edu>
 
        * fcc_skip.c (krb5_fcc_skip_header): If version is not FVNO_4, do not
index f160c6811ad881eaefc5a8ea3d21a5aba167c413..02deb7293b22c8258a4c7a47a9dc12cd9e10784a 100644 (file)
@@ -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;
     }