Fixed some 16 vs. 32 bit conversion problems for the PC
authorKeith Vetter <keithv@fusion.com>
Thu, 2 Mar 1995 00:39:52 +0000 (00:39 +0000)
committerKeith Vetter <keithv@fusion.com>
Thu, 2 Mar 1995 00:39:52 +0000 (00:39 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5053 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/ChangeLog
src/lib/krb5/keytab/Makefile.in
src/lib/krb5/keytab/file/ChangeLog
src/lib/krb5/keytab/file/ktf_util.c

index aa393c88249cd5b11eabeda7aef60967221f30ac..62873e7c79017cbce65ac7f54597f69cfbc8c28a 100644 (file)
@@ -1,3 +1,7 @@
+Wed Mar 3 16:30:00 1995 Keith Vetter (keithv@fusion.com)
+
+       * Makefile.in: changed LIB to LIBCMD for the PC
+
 Tue Feb 28 00:59:22 1995  John Gilmore  (gnu at toad.com)
 
        * *.c:  Avoid <krb5/...> includes.
index 87807387d375efc652807d1eb19a67229d3ece1d..a0f49fc43a80ff56fee6831d11f4c42dbfedda3c 100644 (file)
@@ -27,8 +27,8 @@ all-unix::
 
 all-windows::
        cd file
-       @echo Making in ..\file
-       -$(MAKE) -$(MFLAGS) LIB=$(LIB)
+       @echo Making in .\file
+       -$(MAKE) -$(MFLAGS) LIBCMD=$(LIBCMD)
        cd ..
 
 clean:: clean-$(WHAT)
@@ -37,6 +37,6 @@ clean-unix::
 
 clean-windows::
        cd file
-       @echo Making clean in ..\file
+       @echo Making clean in .\file
        -$(MAKE) -$(MFLAGS) clean
        cd ..
index b0090abd4a375d2d5cdce3b0c0eb691594e79baf..218e4f50ce8699ab7a8db9b03722de3b419de910 100644 (file)
@@ -1,3 +1,7 @@
+Wed Mar 1 16:30:00 1995 Keith Vetter (keithv@fusion.com)
+
+       * ktf_util.c: fixed up some 16 vs 32 bit conversions.
+
 Tue Feb 28 01:01:15 1995  John Gilmore  (gnu at toad.com)
 
        * *.c:  Avoid <krb5/...> includes.
index 84466efc405423a8781bf18d0a56b6e94d874116..c6b17c0f21acf804ed3a6c844c5cf6483f9e500d 100644 (file)
@@ -67,6 +67,8 @@
  * sizeof(krb5_int32) bytes for the key length, followed by the key
  */
 
+#define NEED_WINSOCK_H
+#include "krb5.h"
 #include "k5-int.h"
 #include <stdio.h>
 
@@ -333,7 +335,7 @@ krb5_int32 *delete_point;
            error = ENOMEM;
            goto fail;
     }
-    if (fread(tmpdata, 1, princ_size, KTFILEP(id)) != princ_size) {
+    if (fread(tmpdata, 1, princ_size, KTFILEP(id)) != (size_t) princ_size) {
            free(tmpdata);
            error = KRB5_KT_END;
            goto fail;
@@ -495,9 +497,9 @@ krb5_keytab_entry *entry;
     }
 
     if (KTVERSION(id) == KRB5_KT_VNO_1) {
-           count = entry->principal->length + 1;
+           count = (krb5_int16) entry->principal->length + 1;
     } else {
-           count = htons(entry->principal->length);
+           count = htons((u_short) entry->principal->length);
     }
     
     if (!xfwrite(&count, sizeof(count), 1, KTFILEP(id))) {
@@ -516,7 +518,7 @@ krb5_keytab_entry *entry;
            goto abend;
     }
 
-    count = entry->principal->length;
+    count = (krb5_int16) entry->principal->length;
     for (i = 0; i < count; i++) {
        princ = krb5_princ_component(context, entry->principal, i);
        size = princ->length;
@@ -613,25 +615,25 @@ krb5_ktfileint_size_entry(context, entry, size_needed)
 krb5_keytab_entry *entry;
 krb5_int32 *size_needed;
 {
-    krb5_int16 count, size;
+    krb5_int16 count;
     krb5_int32 total_size, i;
     krb5_error_code retval = 0;
 
-    count = entry->principal->length;
-
+    count = (krb5_int16) entry->principal->length;
+        
     total_size = sizeof(count);
-    total_size += krb5_princ_realm(context, entry->principal)->length + (sizeof(size));
+    total_size += krb5_princ_realm(context, entry->principal)->length + (sizeof(krb5_int16));
     
     for (i = 0; i < count; i++) {
            total_size += krb5_princ_component(context, entry->principal,i)->length
-                   + (sizeof(size));
+                   + (sizeof(krb5_int16));
     }
 
     total_size += sizeof(entry->principal->type);
     total_size += sizeof(entry->timestamp);
     total_size += sizeof(krb5_octet);
     total_size += sizeof(krb5_int16);
-    total_size += sizeof(size) + entry->key.length;
+    total_size += sizeof(krb5_int16) + entry->key.length;
 
     *size_needed = total_size;
     return retval;