summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/krb5/ccache/file/ChangeLog3
-rw-r--r--src/lib/krb5/ccache/file/fcc_maybe.c8
-rw-r--r--src/lib/krb5/ccache/stdio/ChangeLog3
-rw-r--r--src/lib/krb5/ccache/stdio/scc_maybe.c8
4 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog
index 3a2cba8334..9d8e8662dc 100644
--- a/src/lib/krb5/ccache/file/ChangeLog
+++ b/src/lib/krb5/ccache/file/ChangeLog
@@ -4,6 +4,9 @@ Thu Dec 21 18:28:09 1995 Theodore Y. Ts'o <tytso@dcl>
FCC_OPEN_AND_ERASE, unlink the old filename, and then add
the O_EXCL open flag, to prevent O_CREAT from following a
symbolic link.
+ (krb5_fcc_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.
Fri Oct 6 22:03:16 1995 Theodore Y. Ts'o <tytso@dcl>
diff --git a/src/lib/krb5/ccache/file/fcc_maybe.c b/src/lib/krb5/ccache/file/fcc_maybe.c
index 622302a125..2071c681ea 100644
--- a/src/lib/krb5/ccache/file/fcc_maybe.c
+++ b/src/lib/krb5/ccache/file/fcc_maybe.c
@@ -269,7 +269,7 @@ krb5_fcc_open_file (context, id, mode)
sizeof(fcc_fvno)) {
(void) fcc_lock_file(data, fd, UNLOCK_IT);
(void) close(fd);
- return KRB5_CCACHE_BADVNO;
+ return KRB5_CC_FORMAT;
}
if ((fcc_fvno != htons(KRB5_FCC_FVNO_4)) &&
(fcc_fvno != htons(KRB5_FCC_FVNO_3)) &&
@@ -287,14 +287,14 @@ krb5_fcc_open_file (context, id, mode)
!= sizeof(fcc_flen)) {
(void) fcc_lock_file(data, fd, UNLOCK_IT);
(void) close(fd);
- return KRB5_CCACHE_BADVNO;
+ return KRB5_CC_FORMAT;
}
/* Skip past the header info for now */
- if (fcc_flen = htons(fcc_flen)) {
+ if ((fcc_flen = htons(fcc_flen)) != 0) {
if ((krb5_ui_2) read(fd, buf, fcc_flen) != fcc_flen) {
(void) fcc_lock_file(data, fd, UNLOCK_IT);
(void) close(fd);
- return KRB5_CCACHE_BADVNO;
+ return KRB5_CC_FORMAT;
}
}
}
diff --git a/src/lib/krb5/ccache/stdio/ChangeLog b/src/lib/krb5/ccache/stdio/ChangeLog
index e7059f7b35..d86d0fc4de 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 5a535e16cb..ef62617456 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;
}
}
}