diff options
author | Theodore Tso <tytso@mit.edu> | 1995-12-21 23:39:45 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1995-12-21 23:39:45 +0000 |
commit | be92d20ddd4a55d63dd68592e8206bb8f7004ab2 (patch) | |
tree | d11f8eb55d4542fe6394e1345afca7afea20dd0b /src/lib/krb5 | |
parent | 7250cccd2627ff56d8c20f487fae3d2c31fd605b (diff) | |
download | krb5-be92d20ddd4a55d63dd68592e8206bb8f7004ab2.tar.gz krb5-be92d20ddd4a55d63dd68592e8206bb8f7004ab2.tar.xz krb5-be92d20ddd4a55d63dd68592e8206bb8f7004ab2.zip |
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.)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7244 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r-- | src/lib/krb5/ccache/stdio/ChangeLog | 7 | ||||
-rw-r--r-- | src/lib/krb5/ccache/stdio/scc_maybe.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/krb5/ccache/stdio/ChangeLog b/src/lib/krb5/ccache/stdio/ChangeLog index f36b324bf0..e7059f7b35 100644 --- a/src/lib/krb5/ccache/stdio/ChangeLog +++ b/src/lib/krb5/ccache/stdio/ChangeLog @@ -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 diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c index 706b10bf95..5a535e16cb 100644 --- a/src/lib/krb5/ccache/stdio/scc_maybe.c +++ b/src/lib/krb5/ccache/stdio/scc_maybe.c @@ -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: |