From fc0adc2a3f0e58b962709bf0afd35149c1800620 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 26 Oct 2000 17:21:40 +0000 Subject: [PATCH] * 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. 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 | 14 ++++++++++++++ src/lib/krb5/krb/int-proto.h | 7 +++++++ src/lib/krb5/krb/ser_actx.c | 18 ++++++++---------- src/lib/krb5/krb/ser_adata.c | 1 + src/lib/krb5/krb/ser_addr.c | 1 + src/lib/krb5/krb/ser_auth.c | 1 + src/lib/krb5/krb/ser_cksum.c | 1 + src/lib/krb5/krb/ser_key.c | 1 + src/lib/krb5/krb/ser_princ.c | 1 + src/lib/krb5/krb/t_ser.c | 26 +++++++++++++------------- 10 files changed, 48 insertions(+), 23 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 9c6724128..9406c2b78 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,17 @@ +2000-10-26 Ezra Peisach + + * 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 * bld_pr_ext.c, bld_princ.c (krb5_build_principal_ext, diff --git a/src/lib/krb5/krb/int-proto.h b/src/lib/krb5/krb/int-proto.h index 264dcf3ac..d2df9f875 100644 --- a/src/lib/krb5/krb/int-proto.h +++ b/src/lib/krb5/krb/int-proto.h @@ -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__ */ diff --git a/src/lib/krb5/krb/ser_actx.c b/src/lib/krb5/krb/ser_actx.c index bac90e3fe..7d0085855 100644 --- a/src/lib/krb5/krb/ser_actx.c +++ b/src/lib/krb5/krb/ser_actx.c @@ -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 */ diff --git a/src/lib/krb5/krb/ser_adata.c b/src/lib/krb5/krb/ser_adata.c index 8fc04d0e5..1293a9b91 100644 --- a/src/lib/krb5/krb/ser_adata.c +++ b/src/lib/krb5/krb/ser_adata.c @@ -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: diff --git a/src/lib/krb5/krb/ser_addr.c b/src/lib/krb5/krb/ser_addr.c index fd06b36ac..196ecb2f6 100644 --- a/src/lib/krb5/krb/ser_addr.c +++ b/src/lib/krb5/krb/ser_addr.c @@ -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: diff --git a/src/lib/krb5/krb/ser_auth.c b/src/lib/krb5/krb/ser_auth.c index 4c97eb0f3..5c21ebdef 100644 --- a/src/lib/krb5/krb/ser_auth.c +++ b/src/lib/krb5/krb/ser_auth.c @@ -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: diff --git a/src/lib/krb5/krb/ser_cksum.c b/src/lib/krb5/krb/ser_cksum.c index 74657b1ca..ac9757401 100644 --- a/src/lib/krb5/krb/ser_cksum.c +++ b/src/lib/krb5/krb/ser_cksum.c @@ -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: diff --git a/src/lib/krb5/krb/ser_key.c b/src/lib/krb5/krb/ser_key.c index 3b457477d..9ea7b1cdb 100644 --- a/src/lib/krb5/krb/ser_key.c +++ b/src/lib/krb5/krb/ser_key.c @@ -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: diff --git a/src/lib/krb5/krb/ser_princ.c b/src/lib/krb5/krb/ser_princ.c index 956f508db..4435f6e6d 100644 --- a/src/lib/krb5/krb/ser_princ.c +++ b/src/lib/krb5/krb/ser_princ.c @@ -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: diff --git a/src/lib/krb5/krb/t_ser.c b/src/lib/krb5/krb/t_ser.c index 1592a89b4..1bc5f992b 100644 --- a/src/lib/krb5/krb/t_ser.c +++ b/src/lib/krb5/krb/t_ser.c @@ -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))) { -- 2.26.2