From 275acfe3bb1535e07424e3ee968295f31f6242bb Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 3 Sep 2002 22:03:48 +0000 Subject: [PATCH] protoize git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14822 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/ChangeLog | 8 ++ src/lib/krb5/keytab/kt_file.c | 124 ++++++------------------------- src/lib/krb5/keytab/kt_srvtab.c | 61 +++------------ src/lib/krb5/keytab/ktadd.c | 5 +- src/lib/krb5/keytab/ktbase.c | 29 ++------ src/lib/krb5/keytab/ktdefault.c | 4 +- src/lib/krb5/keytab/ktfr_entry.c | 8 +- src/lib/krb5/keytab/ktremove.c | 5 +- src/lib/krb5/keytab/read_servi.c | 8 +- 9 files changed, 54 insertions(+), 198 deletions(-) diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 000e2c1d4..203eb1f74 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,11 @@ +2002-09-03 Ken Raeburn + + * kt_file.c, kt_srvtab.c, ktadd.c, ktbase.c, ktdefault.c, + ktfr_entry.c, ktremove.c, read_servi.c: Use prototype style + function definitions. + + * kt_file.c (errno), kt_srvtab.c (errno): Don't declare. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 7e5b13a30..732933cb2 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -172,10 +172,7 @@ krb5_error_code krb5_ktfileint_find_slot */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_resolve(context, name, id) - krb5_context context; - const char *name; - krb5_keytab *id; +krb5_ktfile_resolve(krb5_context context, const char *name, krb5_keytab *id) { krb5_ktfile_data *data; @@ -210,9 +207,7 @@ krb5_ktfile_resolve(context, name, id) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_close(context, id) - krb5_context context; - krb5_keytab id; +krb5_ktfile_close(krb5_context context, krb5_keytab id) /* * This routine is responsible for freeing all memory allocated * for this keytab. There are no system resources that need @@ -235,13 +230,7 @@ krb5_ktfile_close(context, id) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_get_entry(context, id, principal, kvno, enctype, entry) - krb5_context context; - krb5_keytab id; - krb5_const_principal principal; - krb5_kvno kvno; - krb5_enctype enctype; - krb5_keytab_entry * entry; +krb5_ktfile_get_entry(krb5_context context, krb5_keytab id, krb5_const_principal principal, krb5_kvno kvno, krb5_enctype enctype, krb5_keytab_entry *entry) { krb5_keytab_entry cur_entry, new_entry; krb5_error_code kerror = 0; @@ -376,11 +365,7 @@ krb5_ktfile_get_entry(context, id, principal, kvno, enctype, entry) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_get_name(context, id, name, len) - krb5_context context; - krb5_keytab id; - char *name; - unsigned int len; +krb5_ktfile_get_name(krb5_context context, krb5_keytab id, char *name, unsigned int len) /* * This routine returns the name of the name of the file associated with * this file-based keytab. name is zeroed and the filename is truncated @@ -411,10 +396,7 @@ krb5_ktfile_get_name(context, id, name, len) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_start_seq_get(context, id, cursorp) - krb5_context context; -krb5_keytab id; -krb5_kt_cursor *cursorp; +krb5_ktfile_start_seq_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *cursorp) { krb5_error_code retval; long *fileoff; @@ -437,11 +419,7 @@ krb5_kt_cursor *cursorp; */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_get_next(context, id, entry, cursor) - krb5_context context; -krb5_keytab id; -krb5_keytab_entry *entry; -krb5_kt_cursor *cursor; +krb5_ktfile_get_next(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry, krb5_kt_cursor *cursor) { long *fileoff = (long *)*cursor; krb5_keytab_entry cur_entry; @@ -461,10 +439,7 @@ krb5_kt_cursor *cursor; */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_end_get(context, id, cursor) - krb5_context context; -krb5_keytab id; -krb5_kt_cursor *cursor; +krb5_ktfile_end_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *cursor) { krb5_xfree(*cursor); return krb5_ktfileint_close(context, id); @@ -504,10 +479,7 @@ const krb5_ser_entry krb5_ktfile_ser_entry = { * this krb5_keytab variant. */ static krb5_error_code -krb5_ktf_keytab_size(kcontext, arg, sizep) - krb5_context kcontext; - krb5_pointer arg; - size_t *sizep; +krb5_ktf_keytab_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep) { krb5_error_code kret; krb5_keytab keytab; @@ -551,11 +523,7 @@ krb5_ktf_keytab_size(kcontext, arg, sizep) * krb5_ktf_keytab_externalize() - Externalize the krb5_keytab. */ static krb5_error_code -krb5_ktf_keytab_externalize(kcontext, arg, buffer, lenremain) - krb5_context kcontext; - krb5_pointer arg; - krb5_octet **buffer; - size_t *lenremain; +krb5_ktf_keytab_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **buffer, size_t *lenremain) { krb5_error_code kret; krb5_keytab keytab; @@ -663,11 +631,7 @@ krb5_ktf_keytab_externalize(kcontext, arg, buffer, lenremain) * krb5_ktf_keytab_internalize() - Internalize the krb5_ktf_keytab. */ static krb5_error_code -krb5_ktf_keytab_internalize(kcontext, argp, buffer, lenremain) - krb5_context kcontext; - krb5_pointer *argp; - krb5_octet **buffer; - size_t *lenremain; +krb5_ktf_keytab_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octet **buffer, size_t *lenremain) { krb5_error_code kret; krb5_keytab keytab; @@ -780,10 +744,7 @@ krb5_ktf_keytab_internalize(kcontext, argp, buffer, lenremain) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_wresolve(context, name, id) - krb5_context context; - const char *name; - krb5_keytab *id; +krb5_ktfile_wresolve(krb5_context context, const char *name, krb5_keytab *id) { krb5_ktfile_data *data; @@ -817,10 +778,7 @@ krb5_ktfile_wresolve(context, name, id) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_add(context, id, entry) - krb5_context context; - krb5_keytab id; - krb5_keytab_entry *entry; +krb5_ktfile_add(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) { krb5_error_code retval; @@ -838,10 +796,7 @@ krb5_ktfile_add(context, id, entry) */ krb5_error_code KRB5_CALLCONV -krb5_ktfile_remove(context, id, entry) - krb5_context context; -krb5_keytab id; -krb5_keytab_entry *entry; +krb5_ktfile_remove(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) { krb5_keytab_entry cur_entry; krb5_error_code kerror; @@ -1039,15 +994,8 @@ static char *fopen_mode_rbplus= "r+"; static char *fopen_mode_rb = "r"; #endif -#ifndef HAVE_ERRNO -extern int errno; -#endif - static krb5_error_code -krb5_ktfileint_open(context, id, mode) - krb5_context context; -krb5_keytab id; -int mode; +krb5_ktfileint_open(krb5_context context, krb5_keytab id, int mode) { krb5_error_code kerror; krb5_kt_vno kt_vno; @@ -1105,25 +1053,19 @@ int mode; } krb5_error_code -krb5_ktfileint_openr(context, id) - krb5_context context; -krb5_keytab id; +krb5_ktfileint_openr(krb5_context context, krb5_keytab id) { return krb5_ktfileint_open(context, id, KRB5_LOCKMODE_SHARED); } krb5_error_code -krb5_ktfileint_openw(context, id) - krb5_context context; -krb5_keytab id; +krb5_ktfileint_openw(krb5_context context, krb5_keytab id) { return krb5_ktfileint_open(context, id, KRB5_LOCKMODE_EXCLUSIVE); } krb5_error_code -krb5_ktfileint_close(context, id) - krb5_context context; -krb5_keytab id; +krb5_ktfileint_close(krb5_context context, krb5_keytab id) { krb5_error_code kerror; @@ -1136,10 +1078,7 @@ krb5_keytab id; } krb5_error_code -krb5_ktfileint_delete_entry(context, id, delete_point) - krb5_context context; -krb5_keytab id; -krb5_int32 delete_point; +krb5_ktfileint_delete_entry(krb5_context context, krb5_keytab id, krb5_int32 delete_point) { krb5_int32 size; krb5_int32 len; @@ -1189,11 +1128,7 @@ krb5_int32 delete_point; } krb5_error_code -krb5_ktfileint_internal_read_entry(context, id, ret_entry, delete_point) - krb5_context context; -krb5_keytab id; -krb5_keytab_entry *ret_entry; -krb5_int32 *delete_point; +krb5_ktfileint_internal_read_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *ret_entry, krb5_int32 *delete_point) { krb5_octet vno; krb5_int16 count; @@ -1404,10 +1339,7 @@ fail: } krb5_error_code -krb5_ktfileint_read_entry(context, id, entryp) - krb5_context context; -krb5_keytab id; -krb5_keytab_entry *entryp; +krb5_ktfileint_read_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entryp) { krb5_int32 delete_point; @@ -1415,10 +1347,7 @@ krb5_keytab_entry *entryp; } krb5_error_code -krb5_ktfileint_write_entry(context, id, entry) - krb5_context context; -krb5_keytab id; -krb5_keytab_entry *entry; +krb5_ktfileint_write_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) { krb5_octet vno; krb5_data *princ; @@ -1561,10 +1490,7 @@ krb5_keytab_entry *entry; * keytab entry. */ krb5_error_code -krb5_ktfileint_size_entry(context, entry, size_needed) - krb5_context context; -krb5_keytab_entry *entry; -krb5_int32 *size_needed; +krb5_ktfileint_size_entry(krb5_context context, krb5_keytab_entry *entry, krb5_int32 *size_needed) { krb5_int16 count; krb5_int32 total_size, i; @@ -1603,11 +1529,7 @@ krb5_int32 *size_needed; * block in the file rather than the size of the actual entry) */ krb5_error_code -krb5_ktfileint_find_slot(context, id, size_needed, commit_point) - krb5_context context; -krb5_keytab id; -krb5_int32 *size_needed; -krb5_int32 *commit_point; +krb5_ktfileint_find_slot(krb5_context context, krb5_keytab id, krb5_int32 *size_needed, krb5_int32 *commit_point) { krb5_int32 size; krb5_int32 remainder; diff --git a/src/lib/krb5/keytab/kt_srvtab.c b/src/lib/krb5/keytab/kt_srvtab.c index 663ceced0..56019058b 100644 --- a/src/lib/krb5/keytab/kt_srvtab.c +++ b/src/lib/krb5/keytab/kt_srvtab.c @@ -114,10 +114,7 @@ static krb5_error_code krb5_ktsrvint_read_entry */ static krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_resolve(context, name, id) - krb5_context context; - const char *name; - krb5_keytab *id; +krb5_ktsrvtab_resolve(krb5_context context, const char *name, krb5_keytab *id) { krb5_ktsrvtab_data *data; FILE *fp; @@ -159,9 +156,7 @@ krb5_ktsrvtab_resolve(context, name, id) */ krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_close(context, id) - krb5_context context; - krb5_keytab id; +krb5_ktsrvtab_close(krb5_context context, krb5_keytab id) /* * This routine is responsible for freeing all memory allocated * for this keytab. There are no system resources that need @@ -184,13 +179,7 @@ krb5_ktsrvtab_close(context, id) */ krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_get_entry(context, id, principal, kvno, enctype, entry) - krb5_context context; - krb5_keytab id; - krb5_const_principal principal; - krb5_kvno kvno; - krb5_enctype enctype; - krb5_keytab_entry * entry; +krb5_ktsrvtab_get_entry(krb5_context context, krb5_keytab id, krb5_const_principal principal, krb5_kvno kvno, krb5_enctype enctype, krb5_keytab_entry *entry) { krb5_keytab_entry best_entry, ent; krb5_error_code kerror = 0; @@ -261,11 +250,7 @@ krb5_ktsrvtab_get_entry(context, id, principal, kvno, enctype, entry) */ krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_get_name(context, id, name, len) - krb5_context context; - krb5_keytab id; - char *name; - unsigned int len; +krb5_ktsrvtab_get_name(krb5_context context, krb5_keytab id, char *name, unsigned int len) /* * This routine returns the name of the name of the file associated with * this srvtab-based keytab. The name is prefixed with PREFIX:, so that @@ -295,10 +280,7 @@ krb5_ktsrvtab_get_name(context, id, name, len) */ krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_start_seq_get(context, id, cursorp) - krb5_context context; - krb5_keytab id; - krb5_kt_cursor *cursorp; +krb5_ktsrvtab_start_seq_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *cursorp) { krb5_error_code retval; long *fileoff; @@ -321,11 +303,7 @@ krb5_ktsrvtab_start_seq_get(context, id, cursorp) */ krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_get_next(context, id, entry, cursor) - krb5_context context; - krb5_keytab id; - krb5_keytab_entry *entry; - krb5_kt_cursor *cursor; +krb5_ktsrvtab_get_next(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry, krb5_kt_cursor *cursor) { long *fileoff = (long *)*cursor; krb5_keytab_entry cur_entry; @@ -345,10 +323,7 @@ krb5_ktsrvtab_get_next(context, id, entry, cursor) */ krb5_error_code KRB5_CALLCONV -krb5_ktsrvtab_end_get(context, id, cursor) - krb5_context context; - krb5_keytab id; - krb5_kt_cursor *cursor; +krb5_ktsrvtab_end_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *cursor) { krb5_xfree(*cursor); return krb5_ktsrvint_close(context, id); @@ -422,15 +397,8 @@ struct _krb5_kt_ops krb5_kts_ops = { #define SNAME_SZ 40 #define INST_SZ 40 -#ifndef HAVE_ERRNO -extern int errno; -#endif - static krb5_error_code -read_field(fp, s, len) - FILE *fp; - char *s; - int len; +read_field(FILE *fp, char *s, int len) { int c; @@ -446,9 +414,7 @@ read_field(fp, s, len) } krb5_error_code -krb5_ktsrvint_open(context, id) - krb5_context context; - krb5_keytab id; +krb5_ktsrvint_open(krb5_context context, krb5_keytab id) { KTFILEP(id) = fopen(KTFILENAME(id), READ_MODE); if (!KTFILEP(id)) @@ -457,9 +423,7 @@ krb5_ktsrvint_open(context, id) } krb5_error_code -krb5_ktsrvint_close(context, id) - krb5_context context; - krb5_keytab id; +krb5_ktsrvint_close(krb5_context context, krb5_keytab id) { if (!KTFILEP(id)) return 0; @@ -469,10 +433,7 @@ krb5_ktsrvint_close(context, id) } krb5_error_code -krb5_ktsrvint_read_entry(context, id, ret_entry) - krb5_context context; - krb5_keytab id; - krb5_keytab_entry *ret_entry; +krb5_ktsrvint_read_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *ret_entry) { FILE *fp; char name[SNAME_SZ], instance[INST_SZ], realm[REALM_SZ]; diff --git a/src/lib/krb5/keytab/ktadd.c b/src/lib/krb5/keytab/ktadd.c index 6f1fc0c02..b7c1b9216 100644 --- a/src/lib/krb5/keytab/ktadd.c +++ b/src/lib/krb5/keytab/ktadd.c @@ -30,10 +30,7 @@ #include "k5-int.h" krb5_error_code KRB5_CALLCONV -krb5_kt_add_entry (context, id, entry) - krb5_context context; - krb5_keytab id; - krb5_keytab_entry *entry; +krb5_kt_add_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) { if (id->ops->add) return (*id->ops->add)(context, id, entry); diff --git a/src/lib/krb5/keytab/ktbase.c b/src/lib/krb5/keytab/ktbase.c index 04f07cd10..15ab7fe83 100644 --- a/src/lib/krb5/keytab/ktbase.c +++ b/src/lib/krb5/keytab/ktbase.c @@ -53,9 +53,7 @@ static struct krb5_kt_typelist *kt_typehead = &krb5_kt_typelist_srvtab; */ krb5_error_code KRB5_CALLCONV -krb5_kt_register(context, ops) - krb5_context context; - krb5_kt_ops *ops; +krb5_kt_register(krb5_context context, krb5_kt_ops *ops) { struct krb5_kt_typelist *t; for (t = kt_typehead;t && strcmp(t->ops->prefix,ops->prefix);t = t->next) @@ -82,10 +80,7 @@ krb5_kt_register(context, ops) */ krb5_error_code KRB5_CALLCONV -krb5_kt_resolve (context, name, ktid) - krb5_context context; - const char *name; - krb5_keytab *ktid; +krb5_kt_resolve (krb5_context context, const char *name, krb5_keytab *ktid) { struct krb5_kt_typelist *tlist; char *pfx; @@ -143,10 +138,7 @@ static const krb5_ser_entry krb5_keytab_ser_entry = { }; static krb5_error_code -krb5_keytab_size(kcontext, arg, sizep) - krb5_context kcontext; - krb5_pointer arg; - size_t *sizep; +krb5_keytab_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep) { krb5_error_code kret; krb5_keytab keytab; @@ -162,11 +154,7 @@ krb5_keytab_size(kcontext, arg, sizep) } static krb5_error_code -krb5_keytab_externalize(kcontext, arg, buffer, lenremain) - krb5_context kcontext; - krb5_pointer arg; - krb5_octet **buffer; - size_t *lenremain; +krb5_keytab_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **buffer, size_t *lenremain) { krb5_error_code kret; krb5_keytab keytab; @@ -182,11 +170,7 @@ krb5_keytab_externalize(kcontext, arg, buffer, lenremain) } static krb5_error_code -krb5_keytab_internalize(kcontext, argp, buffer, lenremain) - krb5_context kcontext; - krb5_pointer *argp; - krb5_octet **buffer; - size_t *lenremain; +krb5_keytab_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octet **buffer, size_t *lenremain) { krb5_error_code kret; krb5_ser_handle shandle; @@ -199,8 +183,7 @@ krb5_keytab_internalize(kcontext, argp, buffer, lenremain) } krb5_error_code KRB5_CALLCONV -krb5_ser_keytab_init(kcontext) - krb5_context kcontext; +krb5_ser_keytab_init(krb5_context kcontext) { return(krb5_register_serializer(kcontext, &krb5_keytab_ser_entry)); } diff --git a/src/lib/krb5/keytab/ktdefault.c b/src/lib/krb5/keytab/ktdefault.c index 51ab8745c..971f29f59 100644 --- a/src/lib/krb5/keytab/ktdefault.c +++ b/src/lib/krb5/keytab/ktdefault.c @@ -31,9 +31,7 @@ #include krb5_error_code KRB5_CALLCONV -krb5_kt_default(context, id) - krb5_context context; - krb5_keytab *id; +krb5_kt_default(krb5_context context, krb5_keytab *id) { char defname[BUFSIZ]; krb5_error_code retval; diff --git a/src/lib/krb5/keytab/ktfr_entry.c b/src/lib/krb5/keytab/ktfr_entry.c index c3b80dc90..a86b38bc2 100644 --- a/src/lib/krb5/keytab/ktfr_entry.c +++ b/src/lib/krb5/keytab/ktfr_entry.c @@ -30,9 +30,7 @@ #include "k5-int.h" krb5_error_code KRB5_CALLCONV -krb5_free_keytab_entry_contents (context, entry) - krb5_context context; - krb5_keytab_entry *entry; +krb5_free_keytab_entry_contents (krb5_context context, krb5_keytab_entry *entry) { if (!entry) return 0; @@ -46,9 +44,7 @@ krb5_free_keytab_entry_contents (context, entry) } krb5_error_code KRB5_CALLCONV -krb5_kt_free_entry (context, entry) - krb5_context context; - krb5_keytab_entry *entry; +krb5_kt_free_entry (krb5_context context, krb5_keytab_entry *entry) { return krb5_free_keytab_entry_contents (context, entry); } diff --git a/src/lib/krb5/keytab/ktremove.c b/src/lib/krb5/keytab/ktremove.c index d9599e3d5..d101a7065 100644 --- a/src/lib/krb5/keytab/ktremove.c +++ b/src/lib/krb5/keytab/ktremove.c @@ -30,10 +30,7 @@ #include "k5-int.h" krb5_error_code KRB5_CALLCONV -krb5_kt_remove_entry (context, id, entry) - krb5_context context; - krb5_keytab id; - krb5_keytab_entry *entry; +krb5_kt_remove_entry (krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) { if (id->ops->remove) return (*id->ops->remove)(context, id, entry); diff --git a/src/lib/krb5/keytab/read_servi.c b/src/lib/krb5/keytab/read_servi.c index 141184c37..3455300ab 100644 --- a/src/lib/krb5/keytab/read_servi.c +++ b/src/lib/krb5/keytab/read_servi.c @@ -44,13 +44,7 @@ * errors: error code if not found or keyprocarg is invalid. */ krb5_error_code KRB5_CALLCONV -krb5_kt_read_service_key(context, keyprocarg, principal, vno, enctype, key) - krb5_context context; - krb5_pointer keyprocarg; - krb5_principal principal; - krb5_kvno vno; - krb5_enctype enctype; - krb5_keyblock ** key; +krb5_kt_read_service_key(krb5_context context, krb5_pointer keyprocarg, krb5_principal principal, krb5_kvno vno, krb5_enctype enctype, krb5_keyblock **key) { krb5_error_code kerror = KSUCCESS; char keytabname[MAX_KEYTAB_NAME_LEN + 1]; /* + 1 for NULL termination */ -- 2.26.2