In the case of SCC_OPEN_AND_ERASE, unlink the filename first, in case
authorTheodore Tso <tytso@mit.edu>
Thu, 21 Dec 1995 23:39:45 +0000 (23:39 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 21 Dec 1995 23:39:45 +0000 (23:39 +0000)
there's a symbolic link lurking about.  (We should do an exclusive
open then, but there's no such thing in stdio.)

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

src/lib/krb5/ccache/stdio/ChangeLog
src/lib/krb5/ccache/stdio/scc_maybe.c

index f36b324bf0cbbb60a751d9542d41d3f07a4f80a3..e7059f7b355a8fc6b40cc3d9fcd7524373b13c0f 100644 (file)
@@ -1,3 +1,10 @@
+Thu Dec 21 18:33:39 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * scc_maybe.c (krb5_scc_open_file): In the case of
+               SCC_OPEN_AND_ERASE, unlink the filename first, in case
+               there's a symbolic link lurking about.  (We should do an
+               exclusive open then, but there's no such thing in stdio.)
+
 Mon Sep 25 16:56:51 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * Makefile.in: Removed "foo:: foo-$(WHAT)" lines from the
index 706b10bf95f7ce79e1e3d05ac3e91c531134638f..5a535e16cbc71067c368719f78ea6fd504bf8c0a 100644 (file)
@@ -92,6 +92,9 @@ krb5_scc_open_file (context, id, mode)
 #ifdef ANSI_STDIO
      switch(mode) {
      case SCC_OPEN_AND_ERASE:
+        unlink(data->filename);
+        /* XXX should do an exclusive open here, but no way to do */
+        /* this under stdio */
         open_flag = "wb+";
         break;
      case SCC_OPEN_RDWR:
@@ -105,6 +108,9 @@ krb5_scc_open_file (context, id, mode)
 #else
      switch(mode) {
      case SCC_OPEN_AND_ERASE:
+        unlink(data->filename);
+        /* XXX should do an exclusive open here, but no way to do */
+        /* this under stdio */
         open_flag = "w+";
         break;
      case SCC_OPEN_RDWR: