aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5/ccache/stdio
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1995-12-21 23:55:22 +0000
committerTheodore Tso <tytso@mit.edu>1995-12-21 23:55:22 +0000
commit1b9bcfd033a1c1e823bbf2b75643f9fffbecf185 (patch)
tree4850d6ccbc26997116764f3b870446db551e97cc /src/lib/krb5/ccache/stdio
parent022716c37fbb66711570208fe4002d9b9c249e8b (diff)
downloadkrb5-1b9bcfd033a1c1e823bbf2b75643f9fffbecf185.zip
krb5-1b9bcfd033a1c1e823bbf2b75643f9fffbecf185.tar.gz
krb5-1b9bcfd033a1c1e823bbf2b75643f9fffbecf185.tar.bz2
Use KRB5_CC_FORMAT as an error code instead of KRB5_CCACHE_BADVNO,
when it's really a format error in the credentials cache file. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7248 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/ccache/stdio')
-rw-r--r--src/lib/krb5/ccache/stdio/ChangeLog3
-rw-r--r--src/lib/krb5/ccache/stdio/scc_maybe.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/krb5/ccache/stdio/ChangeLog b/src/lib/krb5/ccache/stdio/ChangeLog
index e7059f7..d86d0fc 100644
--- a/src/lib/krb5/ccache/stdio/ChangeLog
+++ b/src/lib/krb5/ccache/stdio/ChangeLog
@@ -4,6 +4,9 @@ Thu Dec 21 18:33:39 1995 Theodore Y. Ts'o <tytso@dcl>
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.)
+ (krb5_scc_open_file): Use KRB5_CC_FORMAT as an error code
+ instead of KRB5_CCACHE_BADVNO, when it's really a format
+ error in the credentials cache file.
Mon Sep 25 16:56:51 1995 Theodore Y. Ts'o <tytso@dcl>
diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c
index 5a535e1..ef62617 100644
--- a/src/lib/krb5/ccache/stdio/scc_maybe.c
+++ b/src/lib/krb5/ccache/stdio/scc_maybe.c
@@ -165,7 +165,7 @@ krb5_scc_open_file (context, id, mode)
if (!fread((char *)fvno_bytes, sizeof(fvno_bytes), 1, f)) {
(void) krb5_unlock_file(context, fileno(f));
(void) fclose(f);
- return KRB5_CCACHE_BADVNO;
+ return KRB5_CC_FORMAT;
}
data->version = (fvno_bytes[0] << 8) + fvno_bytes[1];
if ((data->version != KRB5_SCC_FVNO_1) &&
@@ -183,13 +183,13 @@ krb5_scc_open_file (context, id, mode)
if (!fread((char *)fvno_bytes, sizeof(fvno_bytes), 1, f)) {
(void) krb5_unlock_file(context, fileno(f));
(void) fclose(f);
- return KRB5_CCACHE_BADVNO;
+ return KRB5_CC_FORMAT;
}
- if (len = (fvno_bytes[0] << 8) + fvno_bytes[1]) {
+ if ((len = (fvno_bytes[0] << 8) + fvno_bytes[1]) != 0) {
if (!fread(buf, len, 1, f)) {
(void) krb5_unlock_file(context, fileno(f));
(void) fclose(f);
- return KRB5_CCACHE_BADVNO;
+ return KRB5_CC_FORMAT;
}
}
}