svn rev #22367: trunk/src/lib/krb5/keytab/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri May 22 20:09:58 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22367
Commit By: ghudson
Log Message:
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.



Changed Files:
U   trunk/src/lib/krb5/keytab/kt_file.c
Modified: trunk/src/lib/krb5/keytab/kt_file.c
===================================================================
--- trunk/src/lib/krb5/keytab/kt_file.c	2009-05-22 17:31:09 UTC (rev 22366)
+++ trunk/src/lib/krb5/keytab/kt_file.c	2009-05-23 00:09:58 UTC (rev 22367)
@@ -1659,6 +1659,9 @@
 	    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))




More information about the cvs-krb5 mailing list