summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-05-23 00:09:58 +0000
committerGreg Hudson <ghudson@mit.edu>2009-05-23 00:09:58 +0000
commit694081fabc4d7133adb741264f0a6a8d8a37d0eb (patch)
tree1cb0810e6b04df77943ac1adb3b53defa7134876 /src
parent7c59287273bfb50559bf4541dd981d877dd2ce35 (diff)
downloadkrb5-694081fabc4d7133adb741264f0a6a8d8a37d0eb.tar.gz
krb5-694081fabc4d7133adb741264f0a6a8d8a37d0eb.tar.xz
krb5-694081fabc4d7133adb741264f0a6a8d8a37d0eb.zip
In krb5_ktfileint_write_entry, add a no-op fseek in between reading
EOF and writing the placeholder length field. Otherwise we can run into an apparent bug in the Solaris 10 stdio library which causes the next no-op fseek after the fwrite to fail with EINVAL. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22367 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/keytab/kt_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c
index 4139da5e0..4c90b8b47 100644
--- a/src/lib/krb5/keytab/kt_file.c
+++ b/src/lib/krb5/keytab/kt_file.c
@@ -1659,6 +1659,9 @@ krb5_ktfileint_find_slot(krb5_context context, krb5_keytab id, krb5_int32 *size_
return errno;
if (!fread(&size, sizeof(size), 1, fp)) {
/* Hit the end of file, reserve this slot. */
+ /* Necessary to avoid a later fseek failing on Solaris 10. */
+ if (fseek(fp, 0, SEEK_CUR))
+ return errno;
/* htonl(0) is 0, so no need to worry about byte order */
size = 0;
if (!fwrite(&size, sizeof(size), 1, fp))