* t_ser.c: Cast getpid() calls to int as arguments to sprintf
authorEzra Peisach <epeisach@mit.edu>
Thu, 26 Oct 2000 17:21:40 +0000 (17:21 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 26 Oct 2000 17:21:40 +0000 (17:21 +0000)
* ser_actx.c: Move prototypes (listed below) to int-proto.h

* int-proto.h: Add prototypes for krb5_ser_authdata_init,
krb5_ser_address_init, krb5_ser_authenticator_init,
krb5_ser_checksum_init, krb5_ser_keyblock_init,
krb5_ser_principal_init.

* ser_adata.c, ser_addr.c, ser_auth.c, ser_cksum.c, ser_key.c,
ser_princ.c: Include int-proto.h for prototypes.

By moving the prototypes to int-proto.h, it ndles the gcc warning
on missing prototypes. These functions are intenal and all used by
krb5_ser_auth_context_init()

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12814 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/int-proto.h
src/lib/krb5/krb/ser_actx.c
src/lib/krb5/krb/ser_adata.c
src/lib/krb5/krb/ser_addr.c
src/lib/krb5/krb/ser_auth.c
src/lib/krb5/krb/ser_cksum.c
src/lib/krb5/krb/ser_key.c
src/lib/krb5/krb/ser_princ.c
src/lib/krb5/krb/t_ser.c

index 9c6724128058e9143f534f237bbf3721e1a637c4..9406c2b78679f7ccd2dd836848f2d3db4a5d1ce6 100644 (file)
@@ -1,3 +1,17 @@
+2000-10-26  Ezra Peisach  <epeisach@mit.edu>
+
+       * t_ser.c: Cast getpid() calls to int as arguments to sprintf.
+
+       * ser_actx.c: Move prototypes (listed below) to int-proto.h
+
+       * int-proto.h: Add prototypes for krb5_ser_authdata_init,
+       krb5_ser_address_init, krb5_ser_authenticator_init,
+       krb5_ser_checksum_init, krb5_ser_keyblock_init,
+       krb5_ser_principal_init.
+       
+       * ser_adata.c, ser_addr.c, ser_auth.c, ser_cksum.c, ser_key.c,
+       ser_princ.c: Include int-proto.h for prototypes.
+
 2000-10-17  Ezra Peisach  <epeisach@mit.edu>
 
        * bld_pr_ext.c, bld_princ.c (krb5_build_principal_ext,
index 264dcf3ac905992f41524bb18721062041a3f426..d2df9f8759085e36dddc2291340e7cc7f391f473 100644 (file)
@@ -41,5 +41,12 @@ krb5_error_code krb5_libdefault_boolean
         KRB5_PROTOTYPE((krb5_context, const krb5_data *, const char *,
                        int *));
 
+krb5_error_code krb5_ser_authdata_init KRB5_PROTOTYPE((krb5_context));
+krb5_error_code krb5_ser_address_init KRB5_PROTOTYPE((krb5_context));
+krb5_error_code krb5_ser_authenticator_init KRB5_PROTOTYPE((krb5_context));
+krb5_error_code krb5_ser_checksum_init KRB5_PROTOTYPE((krb5_context));
+krb5_error_code krb5_ser_keyblock_init KRB5_PROTOTYPE((krb5_context));
+krb5_error_code krb5_ser_principal_init KRB5_PROTOTYPE((krb5_context));
+
 #endif /* KRB5_INT_FUNC_PROTO__ */
 
index bac90e3fe55e7d60408268b2385cbeb30726a646..7d0085855049663ec1832a7f6b24d3f2d353e90d 100644 (file)
@@ -29,6 +29,7 @@
  * ser_actx.c - Serialize krb5_auth_context structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 #include "auth_con.h"
 
 #define        TOKEN_RADDR     950916
@@ -55,12 +56,6 @@ static krb5_error_code krb5_auth_context_internalize
 /*
  * Other metadata serialization initializers.
  */
-krb5_error_code krb5_ser_authdata_init KRB5_PROTOTYPE((krb5_context));
-krb5_error_code krb5_ser_address_init KRB5_PROTOTYPE((krb5_context));
-krb5_error_code krb5_ser_authenticator_init KRB5_PROTOTYPE((krb5_context));
-krb5_error_code krb5_ser_checksum_init KRB5_PROTOTYPE((krb5_context));
-krb5_error_code krb5_ser_keyblock_init KRB5_PROTOTYPE((krb5_context));
-krb5_error_code krb5_ser_principal_init KRB5_PROTOTYPE((krb5_context));
 
 /* Local data */
 static const krb5_ser_entry krb5_auth_context_ser_entry = {
@@ -207,7 +202,8 @@ krb5_auth_context_externalize(kcontext, arg, buffer, lenremain)
     size_t             required;
     krb5_octet         *bp;
     size_t             remain;
-    krb5_int32         obuf;
+    size_t              obuf;
+    krb5_int32         obuf32;
 
     required = 0;
     bp = *buffer;
@@ -241,14 +237,16 @@ krb5_auth_context_externalize(kcontext, arg, buffer, lenremain)
            } else {
                obuf = 0;
            }
-               
+
+           /* Convert to signed 32 bit integer */
+           obuf32 = obuf;
            if (!kret)
-               (void) krb5_ser_pack_int32(obuf, &bp, &remain);
+               (void) krb5_ser_pack_int32(obuf32, &bp, &remain);
 
            /* Now copy i_vector */
            if (!kret && auth_context->i_vector)
                (void) krb5_ser_pack_bytes(auth_context->i_vector,
-                                          (size_t) obuf,
+                                          obuf,
                                           &bp, &remain);
 
            /* Now handle remote_addr, if appropriate */
index 8fc04d0e5e1a8c919f21f287777863f03298ed9d..1293a9b911a421645743f45b36205b920d42d7f7 100644 (file)
@@ -29,6 +29,7 @@
  * ser_adata.c - Serialize a krb5_authdata structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 
 /*
  * Routines to deal with externalizing the krb5_authdata:
index fd06b36ac936499fd929fbacd82063841d5e85e0..196ecb2f6e9d67e8a3a85c692453010ff049aa16 100644 (file)
@@ -29,6 +29,7 @@
  * ser_addr.c - Serialize a krb5_address structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 
 /*
  * Routines to deal with externalizing the krb5_address:
index 4c97eb0f3873323beb0e31141719dda4965978e8..5c21ebdefa7aed2a0f535c18f17f497448a62a65 100644 (file)
@@ -29,6 +29,7 @@
  * ser_auth.c - Serialize krb5_authenticator structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 
 /*
  * Routines to deal with externalizing the krb5_authenticator:
index 74657b1ca0ae08a2f075857868f0d0a79d1f4fd3..ac9757401e56474722bf4ba53cc795ef4c9d6972 100644 (file)
@@ -29,6 +29,7 @@
  * ser_cksum.c - Serialize a krb5_checksum structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 
 /*
  * Routines to deal with externalizing the krb5_checksum:
index 3b457477dde616c43842ac18f2d11ee4f563a099..9ea7b1cdb0e7514d5a209db5b9d8c9eb97b05180 100644 (file)
@@ -29,6 +29,7 @@
  * ser_key.c - Serialize a krb5_keyblock structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 
 /*
  * Routines to deal with externalizing the krb5_keyblock:
index 956f508db573298d3359e37915074e00596a0a13..4435f6e6d948a4adc68f31524e1e132bd7960027 100644 (file)
@@ -29,6 +29,7 @@
  * ser_princ.c - Serialize a krb5_principal structure.
  */
 #include "k5-int.h"
+#include "int-proto.h"
 
 /*
  * Routines to deal with externalizing the krb5_principal:
index 1592a89b4a60f1227609fa878fbdf39b483b0285..1bc5f992b37b5bfbde74724468b620f45945fcd6 100644 (file)
@@ -212,7 +212,7 @@ ser_kcontext_test(kcontext, verbose)
     profile_t          sprofile;
     char               dbname[128];
 
-    sprintf(dbname, "temp_%d", getpid());
+    sprintf(dbname, "temp_%d", (int) getpid());
     sprofile = kcontext->profile;
     kcontext->profile = (profile_t) NULL;
     if (!(kret = ser_data(verbose, "> Context with no profile",
@@ -343,7 +343,7 @@ ser_acontext_test(kcontext, verbose)
                 */
                memset(&aent, 0, sizeof(aent));
                aent.magic = KV5M_AUTHENTICATOR;
-               sprintf(clname, "help/me/%d@this.is.a.test", getpid());
+               sprintf(clname, "help/me/%d@this.is.a.test", (int) getpid());
                actx->authentp = &aent;
                if (!(kret = krb5_parse_name(kcontext, clname,
                                             &aent.client)) &&
@@ -394,9 +394,9 @@ ser_ccache_test(kcontext, verbose)
     krb5_principal     principal;
     extern krb5_cc_ops krb5_scc_ops;
 
-    sprintf(ccname, "temp_cc_%d", getpid());
+    sprintf(ccname, "temp_cc_%d", (int) getpid());
     sprintf(princname, "zowie%d/instance%d@this.is.a.test",
-           getpid(), getpid());
+           (int) getpid(), (int) getpid());
     if (!(kret = krb5_cc_resolve(kcontext, ccname, &ccache)) &&
        !(kret = ser_data(verbose, "> Resolved default ccache",
                          (krb5_pointer) ccache, KV5M_CCACHE)) &&
@@ -406,9 +406,9 @@ ser_ccache_test(kcontext, verbose)
                          (krb5_pointer) ccache, KV5M_CCACHE)) &&
        !(kret = krb5_cc_destroy(kcontext, ccache))) {
        krb5_free_principal(kcontext, principal);
-       sprintf(ccname, "FILE:temp_cc_%d", getpid());
+       sprintf(ccname, "FILE:temp_cc_%d", (int) getpid());
        sprintf(princname, "xxx%d/i%d@this.is.a.test",
-               getpid(), getpid());
+               (int) getpid(), (int) getpid());
        if (!(kret = krb5_cc_resolve(kcontext, ccname, &ccache)) &&
            !(kret = ser_data(verbose, "> Resolved FILE ccache",
                              (krb5_pointer) ccache, KV5M_CCACHE)) &&
@@ -418,9 +418,9 @@ ser_ccache_test(kcontext, verbose)
                              (krb5_pointer) ccache, KV5M_CCACHE)) &&
            !(kret = krb5_cc_destroy(kcontext, ccache))) {
            krb5_free_principal(kcontext, principal);
-           sprintf(ccname, "STDIO:temp_cc_%d", getpid());
+           sprintf(ccname, "STDIO:temp_cc_%d", (int) getpid());
            sprintf(princname, "xxx%d/i%d@this.is.a.test",
-                   getpid(), getpid());
+                   (int) getpid(), (int) getpid());
            if ((kret = krb5_cc_resolve(kcontext, ccname, &ccache)))
                kret = krb5_cc_register(kcontext, &krb5_scc_ops, 1);
            if (!kret &&
@@ -456,17 +456,17 @@ ser_keytab_test(kcontext, verbose)
     krb5_keytab                keytab;
     extern krb5_kt_ops krb5_ktf_writable_ops;
 
-    sprintf(ccname, "temp_kt_%d", getpid());
+    sprintf(ccname, "temp_kt_%d", (int) getpid());
     if (!(kret = krb5_kt_resolve(kcontext, ccname, &keytab)) &&
        !(kret = ser_data(verbose, "> Resolved default keytab",
                          (krb5_pointer) keytab, KV5M_KEYTAB)) &&
        !(kret = krb5_kt_close(kcontext, keytab))) {
-       sprintf(ccname, "FILE:temp_kt_%d", getpid());
+       sprintf(ccname, "FILE:temp_kt_%d", (int) getpid());
        if (!(kret = krb5_kt_resolve(kcontext, ccname, &keytab)) &&
            !(kret = ser_data(verbose, "> Resolved FILE keytab",
                              (krb5_pointer) keytab, KV5M_KEYTAB)) &&
            !(kret = krb5_kt_close(kcontext, keytab))) {
-           sprintf(ccname, "WRFILE:temp_kt_%d", getpid());
+           sprintf(ccname, "WRFILE:temp_kt_%d", (int) getpid());
            if ((kret = krb5_kt_resolve(kcontext, ccname, &keytab)))
                kret = krb5_kt_register(kcontext, &krb5_ktf_writable_ops);
            if (!kret &&
@@ -496,7 +496,7 @@ ser_rcache_test(kcontext, verbose)
     char               rcname[128];
     krb5_rcache                rcache;
 
-    sprintf(rcname, "dfl:temp_rc_%d", getpid());
+    sprintf(rcname, "dfl:temp_rc_%d", (int) getpid());
     if (!(kret = krb5_rc_resolve_full(kcontext, &rcache, rcname)) &&
        !(kret = ser_data(verbose, "> Resolved FILE rcache",
                          (krb5_pointer) rcache, KV5M_RCACHE)) &&
@@ -578,7 +578,7 @@ ser_princ_test(kcontext, verbose)
     krb5_principal     princ;
     char               pname[1024];
 
-    sprintf(pname, "the/quick/brown/fox/jumped/over/the/lazy/dog/%d@this.is.a.test", getpid());
+    sprintf(pname, "the/quick/brown/fox/jumped/over/the/lazy/dog/%d@this.is.a.test", (int) getpid());
     if (!(kret = krb5_parse_name(kcontext, pname, &princ))) {
        if (!(kret = ser_data(verbose, "> Principal",
                              (krb5_pointer) princ, KV5M_PRINCIPAL))) {