From: Ken Raeburn Date: Wed, 11 Sep 2002 03:59:27 +0000 (+0000) Subject: protoize X-Git-Tag: krb5-1.3-alpha1~408 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fd436037e22cf5f50b6d4c9d4f32929576d60f0c;p=krb5.git protoize git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14841 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index dfc427a9f..d4d1bd727 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,5 +1,10 @@ 2002-09-10 Ken Raeburn + * dispatch.c, do_as_req.c, do_tgs_req.c, kdc_preauth.c, + kdc_util.c, kerberos_v4.c, main.c, network.c, policy.c, replay.c, + rtest.c: Use prototype-style function definitions and + declarations. Don't declare errno. + * do_as_req.c (prepare_error_as): New argument, the error message text as determined *before* possibly replacing the error code with "generic error". diff --git a/src/kdc/dispatch.c b/src/kdc/dispatch.c index 11d267e2b..d97acfaee 100644 --- a/src/kdc/dispatch.c +++ b/src/kdc/dispatch.c @@ -39,10 +39,7 @@ static krb5_int32 last_usec = 0, last_os_random = 0; krb5_error_code -dispatch(pkt, from, response) - krb5_data *pkt; - const krb5_fulladdr *from; - krb5_data **response; +dispatch(krb5_data *pkt, const krb5_fulladdr *from, krb5_data **response) { krb5_error_code retval; diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 83805d458..77a1afd27 100644 --- a/src/kdc/do_as_req.c +++ b/src/kdc/do_as_req.c @@ -51,10 +51,8 @@ static krb5_error_code prepare_error_as (krb5_kdc_req *, int, krb5_data *, /*ARGSUSED*/ krb5_error_code -process_as_req(request, from, response) - krb5_kdc_req *request; - const krb5_fulladdr *from; /* who sent it ? */ - krb5_data **response; /* filled in with a response packet */ +process_as_req(krb5_kdc_req *request, const krb5_fulladdr *from, + krb5_data **response) { krb5_db_entry client, server; krb5_kdc_rep reply; diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c index 923f8b575..0c6116e21 100644 --- a/src/kdc/do_tgs_req.c +++ b/src/kdc/do_tgs_req.c @@ -55,10 +55,8 @@ static krb5_error_code prepare_error_tgs (krb5_kdc_req *, krb5_ticket *, /*ARGSUSED*/ krb5_error_code -process_tgs_req(pkt, from, response) - krb5_data *pkt; - const krb5_fulladdr *from; /* who sent it ? */ - krb5_data **response; /* filled in with a response packet */ +process_tgs_req(krb5_data *pkt, const krb5_fulladdr *from, + krb5_data **response) { krb5_keyblock * subkey; krb5_kdc_req *request = 0; diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c index 8352a3fdb..7c0c3f24f 100644 --- a/src/kdc/kdc_preauth.c +++ b/src/kdc/kdc_preauth.c @@ -185,9 +185,7 @@ static krb5_preauth_systems preauth_systems[] = { #define MAX_PREAUTH_SYSTEMS (sizeof(preauth_systems)/sizeof(preauth_systems[0])) static krb5_error_code -find_pa_system(type, preauth) - int type; - krb5_preauth_systems **preauth; +find_pa_system(int type, krb5_preauth_systems **preauth) { krb5_preauth_systems *ap = preauth_systems; @@ -199,9 +197,9 @@ find_pa_system(type, preauth) return 0; } -const char *missing_required_preauth(client, server, enc_tkt_reply) - krb5_db_entry *client, *server; - krb5_enc_tkt_part *enc_tkt_reply; +const char *missing_required_preauth(krb5_db_entry *client, + krb5_db_entry *server, + krb5_enc_tkt_part *enc_tkt_reply) { #if 0 /* @@ -236,10 +234,8 @@ const char *missing_required_preauth(client, server, enc_tkt_reply) return 0; } -void get_preauth_hint_list(request, client, server, e_data) - krb5_kdc_req *request; - krb5_db_entry *client, *server; - krb5_data *e_data; +void get_preauth_hint_list(krb5_kdc_req *request, krb5_db_entry *client, + krb5_db_entry *server, krb5_data *e_data) { int hw_only; krb5_preauth_systems *ap; @@ -306,11 +302,8 @@ errout: */ krb5_error_code -check_padata (context, client, request, enc_tkt_reply) - krb5_context context; - krb5_db_entry * client; - krb5_kdc_req * request; - krb5_enc_tkt_part * enc_tkt_reply; +check_padata (krb5_context context, krb5_db_entry *client, + krb5_kdc_req *request, krb5_enc_tkt_part *enc_tkt_reply) { krb5_error_code retval = 0; krb5_pa_data **padata; @@ -373,14 +366,9 @@ check_padata (context, client, request, enc_tkt_reply) * structures which should be returned by the KDC to the client */ krb5_error_code -return_padata(context, client, request, reply, - client_key, encrypting_key) - krb5_context context; - krb5_db_entry * client; - krb5_kdc_req * request; - krb5_kdc_rep * reply; - krb5_key_data * client_key; - krb5_keyblock * encrypting_key; +return_padata(krb5_context context, krb5_db_entry *client, + krb5_kdc_req *request, krb5_kdc_rep *reply, + krb5_key_data *client_key, krb5_keyblock *encrypting_key) { krb5_error_code retval; krb5_pa_data ** padata; @@ -436,12 +424,9 @@ cleanup: } static krb5_error_code -verify_enc_timestamp(context, client, request, enc_tkt_reply, pa) - krb5_context context; - krb5_db_entry * client; - krb5_kdc_req * request; - krb5_enc_tkt_part * enc_tkt_reply; - krb5_pa_data * pa; +verify_enc_timestamp(krb5_context context, krb5_db_entry *client, + krb5_kdc_req *request, krb5_enc_tkt_part *enc_tkt_reply, + krb5_pa_data *pa) { krb5_pa_enc_ts * pa_enc = 0; krb5_error_code retval; @@ -517,12 +502,9 @@ cleanup: * message. */ static krb5_error_code -get_etype_info(context, request, client, server, pa_data) - krb5_context context; - krb5_kdc_req * request; - krb5_db_entry * client; - krb5_db_entry * server; - krb5_pa_data * pa_data; +get_etype_info(krb5_context context, krb5_kdc_req *request, + krb5_db_entry *client, krb5_db_entry *server, + krb5_pa_data *pa_data) { krb5_etype_info_entry ** entry = 0; krb5_key_data *client_key; @@ -600,16 +582,10 @@ cleanup: } static krb5_error_code -return_pw_salt(context, in_padata, client, request, reply, client_key, - encrypting_key, send_pa) - krb5_context context; - krb5_pa_data * in_padata; - krb5_db_entry * client; - krb5_kdc_req * request; - krb5_kdc_rep * reply; - krb5_key_data * client_key; - krb5_keyblock * encrypting_key; - krb5_pa_data ** send_pa; +return_pw_salt(krb5_context context, krb5_pa_data *in_padata, + krb5_db_entry *client, krb5_kdc_req *request, + krb5_kdc_rep *reply, krb5_key_data *client_key, + krb5_keyblock *encrypting_key, krb5_pa_data **send_pa) { krb5_error_code retval; krb5_pa_data * padata; @@ -688,16 +664,10 @@ cleanup: } static krb5_error_code -return_sam_data(context, in_padata, client, request, reply, client_key, - encrypting_key, send_pa) - krb5_context context; - krb5_pa_data * in_padata; - krb5_db_entry * client; - krb5_kdc_req * request; - krb5_kdc_rep * reply; - krb5_key_data * client_key; - krb5_keyblock * encrypting_key; - krb5_pa_data ** send_pa; +return_sam_data(krb5_context context, krb5_pa_data *in_padata, + krb5_db_entry *client, krb5_kdc_req *request, + krb5_kdc_rep *reply, krb5_key_data *client_key, + krb5_keyblock *encrypting_key, krb5_pa_data **send_pa) { krb5_error_code retval; krb5_data scratch; @@ -834,12 +804,9 @@ static struct { }; static krb5_error_code -get_sam_edata(context, request, client, server, pa_data) - krb5_context context; - krb5_kdc_req * request; - krb5_db_entry * client; - krb5_db_entry * server; - krb5_pa_data * pa_data; +get_sam_edata(krb5_context context, krb5_kdc_req *request, + krb5_db_entry *client, krb5_db_entry *server, + krb5_pa_data *pa_data) { krb5_error_code retval; krb5_sam_challenge sc; @@ -1209,12 +1176,9 @@ cleanup: } static krb5_error_code -verify_sam_response(context, client, request, enc_tkt_reply, pa) - krb5_context context; - krb5_db_entry * client; - krb5_kdc_req * request; - krb5_enc_tkt_part * enc_tkt_reply; - krb5_pa_data * pa; +verify_sam_response(krb5_context context, krb5_db_entry *client, + krb5_kdc_req *request, krb5_enc_tkt_part *enc_tkt_reply, + krb5_pa_data *pa) { krb5_error_code retval; krb5_data scratch; diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 779d0a80f..6dff24189 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -47,9 +47,7 @@ krb5_deltat rc_lifetime; /* See kdc_initialize_rcache() */ * initialize the replay cache. */ krb5_error_code -kdc_initialize_rcache(kcontext, rcache_name) - krb5_context kcontext; - char *rcache_name; +kdc_initialize_rcache(krb5_context kcontext, char *rcache_name) { krb5_error_code retval; char *rcname; @@ -90,10 +88,8 @@ kdc_initialize_rcache(kcontext, rcache_name) * The replacement should be freed with krb5_free_authdata(). */ krb5_error_code -concat_authorization_data(first, second, output) -krb5_authdata **first; -krb5_authdata **second; -krb5_authdata ***output; +concat_authorization_data(krb5_authdata **first, krb5_authdata **second, + krb5_authdata ***output) { register int i, j; register krb5_authdata **ptr, **retdata; @@ -139,9 +135,7 @@ krb5_authdata ***output; } krb5_boolean -realm_compare(princ1, princ2) - krb5_principal princ1; - krb5_principal princ2; +realm_compare(krb5_principal princ1, krb5_principal princ2) { krb5_data *realm1 = krb5_princ_realm(kdc_context, princ1); krb5_data *realm2 = krb5_princ_realm(kdc_context, princ2); @@ -154,8 +148,7 @@ realm_compare(princ1, princ2) * Returns TRUE if the kerberos principal is the name of a Kerberos ticket * service. */ -krb5_boolean krb5_is_tgs_principal(principal) - krb5_principal principal; +krb5_boolean krb5_is_tgs_principal(krb5_principal principal) { if ((krb5_princ_component(kdc_context, principal, 0)->length == KRB5_TGS_NAME_SIZE) && @@ -170,11 +163,8 @@ krb5_boolean krb5_is_tgs_principal(principal) * for source data. */ static krb5_error_code -comp_cksum(kcontext, source, ticket, his_cksum) - krb5_context kcontext; - krb5_data * source; - krb5_ticket * ticket; - krb5_checksum * his_cksum; +comp_cksum(krb5_context kcontext, krb5_data *source, krb5_ticket *ticket, + krb5_checksum *his_cksum) { krb5_error_code retval; krb5_boolean valid; @@ -199,12 +189,9 @@ comp_cksum(kcontext, source, ticket, his_cksum) } krb5_error_code -kdc_process_tgs_req(request, from, pkt, ticket, subkey) - krb5_kdc_req * request; - const krb5_fulladdr * from; - krb5_data * pkt; - krb5_ticket ** ticket; - krb5_keyblock ** subkey; +kdc_process_tgs_req(krb5_kdc_req *request, const krb5_fulladdr *from, + krb5_data *pkt, krb5_ticket **ticket, + krb5_keyblock **subkey) { krb5_pa_data ** tmppa; krb5_ap_req * apreq; @@ -393,10 +380,7 @@ cleanup: * much else. -- tlyu */ krb5_error_code -kdc_get_server_key(ticket, key, kvno) - krb5_ticket * ticket; - krb5_keyblock ** key; - krb5_kvno * kvno; /* XXX nothing uses this */ +kdc_get_server_key(krb5_ticket *ticket, krb5_keyblock **key, krb5_kvno *kvno) { krb5_error_code retval; krb5_db_entry server; @@ -452,9 +436,7 @@ static krb5_last_req_entry nolrentry = { KV5M_LAST_REQ_ENTRY, KRB5_LRQ_NONE, 0 } static krb5_last_req_entry *nolrarray[] = { &nolrentry, 0 }; krb5_error_code -fetch_last_req_info(dbentry, lrentry) -krb5_db_entry *dbentry; -krb5_last_req_entry ***lrentry; +fetch_last_req_info(krb5_db_entry *dbentry, krb5_last_req_entry ***lrentry) { *lrentry = nolrarray; return 0; @@ -464,8 +446,7 @@ krb5_last_req_entry ***lrentry; /* XXX! This is a temporary place-holder */ krb5_error_code -check_hot_list(ticket) -krb5_ticket *ticket; +check_hot_list(krb5_ticket *ticket) { return 0; } @@ -495,9 +476,7 @@ krb5_ticket *ticket; * If r2 is not a subrealm, SUBREALM returns 0. */ static int -subrealm(r1,r2) -char *r1; -char *r2; +subrealm(char *r1, char *r2) { size_t l1,l2; l1 = strlen(r1); @@ -569,12 +548,9 @@ char *r2; */ krb5_error_code -add_to_transited(tgt_trans, new_trans, tgs, client, server) - krb5_data * tgt_trans; - krb5_data * new_trans; - krb5_principal tgs; - krb5_principal client; - krb5_principal server; +add_to_transited(krb5_data *tgt_trans, krb5_data *new_trans, + krb5_principal tgs, krb5_principal client, + krb5_principal server) { krb5_error_code retval; char *realm; @@ -855,12 +831,9 @@ fail: KDC_OPT_ALLOW_POSTDATE | KDC_OPT_POSTDATED | \ KDC_OPT_RENEWABLE | KDC_OPT_RENEWABLE_OK) int -validate_as_request(request, client, server, kdc_time, status) -register krb5_kdc_req *request; -krb5_db_entry client; -krb5_db_entry server; -krb5_timestamp kdc_time; -const char **status; +validate_as_request(register krb5_kdc_req *request, krb5_db_entry client, + krb5_db_entry server, krb5_timestamp kdc_time, + const char **status) { int errcode; @@ -993,8 +966,7 @@ const char **status; * returns -1 on failure. */ static int -asn1length(astream) -unsigned char **astream; +asn1length(unsigned char **astream) { int length; /* resulting length */ int sublen; /* sublengths */ @@ -1045,11 +1017,8 @@ unsigned char **astream; * returns 0 on success, -1 otherwise. */ int -fetch_asn1_field(astream, level, field, data) -unsigned char *astream; -unsigned int level; -unsigned int field; -krb5_data *data; +fetch_asn1_field(unsigned char *astream, unsigned int level, + unsigned int field, krb5_data *data) { unsigned char *estream; /* end of stream */ int classes; /* # classes seen so far this level */ @@ -1136,12 +1105,9 @@ krb5_data *data; KDC_OPT_VALIDATE) int -validate_tgs_request(request, server, ticket, kdc_time, status) -register krb5_kdc_req *request; -krb5_db_entry server; -krb5_ticket *ticket; -krb5_timestamp kdc_time; -const char **status; +validate_tgs_request(register krb5_kdc_req *request, krb5_db_entry server, + krb5_ticket *ticket, krb5_timestamp kdc_time, + const char **status) { int errcode; int st_idx = 0; @@ -1386,10 +1352,8 @@ const char **status; * keytype, and 0 if not. */ int -dbentry_has_key_for_enctype(context, client, enctype) - krb5_context context; - krb5_db_entry * client; - krb5_enctype enctype; +dbentry_has_key_for_enctype(krb5_context context, krb5_db_entry *client, + krb5_enctype enctype) { krb5_error_code retval; krb5_key_data *datap; @@ -1412,10 +1376,8 @@ dbentry_has_key_for_enctype(context, client, enctype) * options bits for now. */ int -dbentry_supports_enctype(context, client, enctype) - krb5_context context; - krb5_db_entry * client; - krb5_enctype enctype; +dbentry_supports_enctype(krb5_context context, krb5_db_entry *client, + krb5_enctype enctype) { /* * If it's DES_CBC_MD5, there's a bit in the attribute mask which @@ -1447,11 +1409,8 @@ dbentry_supports_enctype(context, client, enctype) * requested, and what the KDC and the application server can support. */ krb5_enctype -select_session_keytype(context, server, nktypes, ktype) - krb5_context context; - krb5_db_entry * server; - int nktypes; - krb5_enctype *ktype; +select_session_keytype(krb5_context context, krb5_db_entry *server, + int nktypes, krb5_enctype *ktype) { int i; @@ -1472,11 +1431,8 @@ select_session_keytype(context, server, nktypes, ktype) * This function returns salt information for a particular client_key */ krb5_error_code -get_salt_from_key(context, client, client_key, salt) - krb5_context context; - krb5_principal client; - krb5_key_data * client_key; - krb5_data * salt; +get_salt_from_key(krb5_context context, krb5_principal client, + krb5_key_data *client_key, krb5_data *salt) { krb5_error_code retval; krb5_data * realm; diff --git a/src/kdc/kerberos_v4.c b/src/kdc/kerberos_v4.c index a1f271494..b43a521a2 100644 --- a/src/kdc/kerberos_v4.c +++ b/src/kdc/kerberos_v4.c @@ -70,8 +70,6 @@ extern void swab(const void *, void *, size_t ); #endif -extern int errno; - static int compat_decrypt_key (krb5_key_data *, C_Block, krb5_keyblock *, int); static int kerb_get_principal (char *, char *, Principal *, int, @@ -124,7 +122,7 @@ static long n_appl_req; static long pause_int = -1; -static void hang(); +static void hang(void); /* v4/v5 backwards-compatibility stub routines, @@ -184,9 +182,7 @@ static const struct v4mode_lookup_entry v4mode_table[] = { static const int v4mode_table_nents = sizeof(v4mode_table)/ sizeof(v4mode_table[0]); -void process_v4_mode(program_name, string) - const char *program_name; - const char *string; +void process_v4_mode(const char *program_name, const char *string) { int i, found; @@ -212,10 +208,8 @@ void process_v4_mode(program_name, string) } krb5_error_code -process_v4( pkt, client_fulladdr, resp) - const krb5_data *pkt; - const krb5_fulladdr *client_fulladdr; - krb5_data **resp; +process_v4(const krb5_data *pkt, const krb5_fulladdr *client_fulladdr, + krb5_data **resp) { struct sockaddr_in client_sockaddr; krb5_address *addr = client_fulladdr->address; @@ -306,12 +300,8 @@ char * v4_klog( type, format, va_alist) } static -int krb4_sendto(s, msg, len, flags, to, to_len) -int s; -const char *msg; -int len, flags; -const struct sockaddr *to; -int to_len; +int krb4_sendto(int s, const char *msg, int len, int flags, + const struct sockaddr *to, int to_len) { if ( !(response = (krb5_data *) malloc( sizeof *response))) { return ENOMEM; @@ -325,7 +315,7 @@ int to_len; return( 0); } static void -hang() +hang(void) { if (pause_int == -1) { klog(L_KRB_PERR, "Kerberos will pause so as not to loop init"); @@ -358,11 +348,8 @@ hang() * Also, keep old krb5_keyblock around in case we want to use it later. */ static int -compat_decrypt_key (in5, out4, out5, issrv) - krb5_key_data *in5; - C_Block out4; - krb5_keyblock *out5; - int issrv; /* whether it's a server key */ +compat_decrypt_key (krb5_key_data *in5, unsigned char *out4, + krb5_keyblock *out5, int issrv) { krb5_error_code retval; @@ -404,17 +391,13 @@ compat_decrypt_key (in5, out4, out5, issrv) */ static int -kerb_get_principal(name, inst, principal, maxn, more, k5key, kvno, - issrv, k5life) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - int maxn; /* max number of name structs to return */ - int *more; /* more tuples than room for */ - krb5_keyblock *k5key; - krb5_kvno kvno; - int issrv; /* true if retrieving a service key */ - krb5_deltat *k5life; +kerb_get_principal(char *name, char *inst, /* could have wild cards */ + Principal *principal, + int maxn, /* max # name structs to return */ + int *more, /* more tuples than room for */ + krb5_keyblock *k5key, krb5_kvno kvno, + int issrv, /* true if retrieving a service key */ + krb5_deltat *k5life) { /* Note that this structure should not be passed to the krb5_free* functions, because the pointers within it point @@ -575,9 +558,7 @@ kerb_get_principal(name, inst, principal, maxn, more, k5key, kvno, return( nprinc); } -static void str_length_check(str, max_size) - char *str; - int max_size; +static void str_length_check(char *str, int max_size) { int i; char *cp; @@ -590,9 +571,7 @@ static void str_length_check(str, max_size) } void -kerberos_v4(client, pkt) - struct sockaddr_in *client; - KTEXT pkt; +kerberos_v4(struct sockaddr_in *client, KTEXT pkt) { static KTEXT_ST rpkt_st; KTEXT rpkt = &rpkt_st; @@ -1012,12 +991,7 @@ kerberos_v4(client, pkt) */ void -kerb_err_reply(client, pkt, err, string) - struct sockaddr_in *client; - KTEXT pkt; - long err; - char *string; - +kerb_err_reply(struct sockaddr_in *client, KTEXT pkt, long int err, char *string) { static KTEXT_ST e_pkt_st; KTEXT e_pkt = &e_pkt_st; @@ -1040,13 +1014,12 @@ kerb_err_reply(client, pkt, err, string) * "25-Jan-88 10:17:56" */ -static char *krb4_stime(t) - long *t; +static char *krb4_stime(long int *t) { static char st[40]; static time_t adjusted_time; struct tm *tm; - char *month_sname(); + extern char *month_sname(int); adjusted_time = *t /* - CONVERT_TIME_EPOCH */; tm = localtime(&adjusted_time); @@ -1057,15 +1030,8 @@ static char *krb4_stime(t) } static int -check_princ(p_name, instance, lifetime, p, k5key, issrv, k5life) - char *p_name; - char *instance; - int lifetime; - - Principal *p; - krb5_keyblock *k5key; - int issrv; /* whether this is a server key */ - krb5_deltat *k5life; +check_princ(char *p_name, char *instance, int lifetime, Principal *p, + krb5_keyblock *k5key, int issrv, krb5_deltat *k5life) { static int n; static int more; @@ -1168,9 +1134,7 @@ check_princ(p_name, instance, lifetime, p, k5key, issrv, k5life) /* Set the key for krb_rd_req so we can check tgt */ static int -set_tgtkey(r, kvno) - char *r; /* Realm for desired key */ - krb5_kvno kvno; +set_tgtkey(char *r, krb5_kvno kvno) { int n; static char lastrealm[REALM_SZ] = ""; diff --git a/src/kdc/main.c b/src/kdc/main.c index a8d36cdde..f8a8f8c81 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -78,9 +78,7 @@ static struct sigaction s_action; * Find the realm entry for a given realm. */ kdc_realm_t * -find_realm_data(rname, rsize) - char *rname; - krb5_ui_4 rsize; +find_realm_data(char *rname, krb5_ui_4 rsize) { int i; for (i=0; irealm_dbname) free(rdp->realm_dbname); @@ -154,16 +150,9 @@ finish_realm(rdp) * realm data and we should be all set to begin operation for that realm. */ static krb5_error_code -init_realm(progname, rdp, realm, def_dbname, def_mpname, - def_enctype, def_ports, def_manual) - char *progname; - kdc_realm_t *rdp; - char *realm; - char *def_dbname; - char *def_mpname; - krb5_enctype def_enctype; - char *def_ports; - krb5_boolean def_manual; +init_realm(char *progname, kdc_realm_t *rdp, char *realm, char *def_dbname, + char *def_mpname, krb5_enctype def_enctype, char *def_ports, + krb5_boolean def_manual) { krb5_error_code kret; krb5_boolean manual; @@ -503,8 +492,7 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, } krb5_sigtype -request_exit(signo) - int signo; +request_exit(int signo) { signal_requests_exit = 1; @@ -516,8 +504,7 @@ request_exit(signo) } krb5_sigtype -request_hup(signo) - int signo; +request_hup(int signo) { signal_requests_hup = 1; @@ -529,7 +516,7 @@ request_hup(signo) } void -setup_signal_handlers() +setup_signal_handlers(void) { #ifdef POSIX_SIGNALS (void) sigemptyset(&s_action.sa_mask); @@ -549,24 +536,20 @@ setup_signal_handlers() } krb5_error_code -setup_sam() +setup_sam(void) { return krb5_c_make_random_key(kdc_context, ENCTYPE_DES_CBC_MD5, &psr_key); } void -usage(name) -char *name; +usage(char *name) { fprintf(stderr, "usage: %s [-d dbpathname] [-r dbrealmname] [-R replaycachename ]\n\t[-m] [-k masterenctype] [-M masterkeyname] [-p port] [-4 v4mode] [-n]\n", name); return; } void -initialize_realms(kcontext, argc, argv) - krb5_context kcontext; - int argc; - char **argv; +initialize_realms(krb5_context kcontext, int argc, char **argv) { int c; char *db_name = (char *) NULL; @@ -731,8 +714,7 @@ initialize_realms(kcontext, argc, argv) } void -finish_realms(prog) - char *prog; +finish_realms(char *prog) { int i; @@ -766,9 +748,7 @@ finish_realms(prog) exit */ -int main(argc, argv) - int argc; - char *argv[]; +int main(int argc, char **argv) { krb5_error_code retval; krb5_context kcontext; diff --git a/src/kdc/network.c b/src/kdc/network.c index 8442b2196..62142f1e1 100644 --- a/src/kdc/network.c +++ b/src/kdc/network.c @@ -58,8 +58,6 @@ #include "fake-addrinfo.h" -extern int errno; - static int *udp_port_fds = (int *) NULL; static u_short *udp_port_nums = (u_short *) NULL; static int n_udp_ports = 0; @@ -70,8 +68,7 @@ static int select_nfds; #define safe_realloc(p,n) ((p)?(realloc(p,n)):(malloc(n))) -static krb5_error_code add_port(port) - u_short port; +static krb5_error_code add_port(u_short port) { int i; u_short *new_ports; @@ -214,8 +211,7 @@ setup_port(void *P_data, struct sockaddr *addr) } krb5_error_code -setup_network(prog) - const char *prog; +setup_network(const char *prog) { struct socksetup setup_data; krb5_error_code retval; @@ -257,9 +253,7 @@ setup_network(prog) return 0; } -static void process_packet(port_fd, prog) - int port_fd; - const char *prog; +static void process_packet(int port_fd, const char *prog) { int cc, saddr_len; krb5_fulladdr faddr; @@ -343,8 +337,7 @@ static void process_packet(port_fd, prog) } krb5_error_code -listen_and_process(prog) -const char *prog; +listen_and_process(const char *prog) { int nfound; fd_set readfds; @@ -379,8 +372,7 @@ const char *prog; } krb5_error_code -closedown_network(prog) -const char *prog; +closedown_network(const char *prog) { int i; diff --git a/src/kdc/policy.c b/src/kdc/policy.c index 60e7ffea5..8c0b69272 100644 --- a/src/kdc/policy.c +++ b/src/kdc/policy.c @@ -30,12 +30,9 @@ #include "kdc_util.h" int -against_local_policy_as(request, client, server, kdc_time, status) -register krb5_kdc_req *request; -krb5_db_entry client; -krb5_db_entry server; -krb5_timestamp kdc_time; -const char **status; +against_local_policy_as(register krb5_kdc_req *request, krb5_db_entry client, + krb5_db_entry server, krb5_timestamp kdc_time, + const char **status) { #if 0 /* An AS request must include the addresses field */ @@ -52,11 +49,8 @@ const char **status; * This is where local policy restrictions for the TGS should placed. */ krb5_error_code -against_local_policy_tgs(request, server, ticket, status) -register krb5_kdc_req *request; -krb5_db_entry server; -krb5_ticket *ticket; -const char **status; +against_local_policy_tgs(register krb5_kdc_req *request, krb5_db_entry server, + krb5_ticket *ticket, const char **status) { #if 0 /* diff --git a/src/kdc/replay.c b/src/kdc/replay.c index cc0d68f45..8bb79abfa 100644 --- a/src/kdc/replay.c +++ b/src/kdc/replay.c @@ -71,10 +71,8 @@ static int num_entries = 0; FALSE if the caller should do the work */ krb5_boolean -kdc_check_lookaside(inpkt, from, outpkt) - register krb5_data *inpkt; - register const krb5_fulladdr *from; - register krb5_data **outpkt; +kdc_check_lookaside(krb5_data *inpkt, const krb5_fulladdr *from, + krb5_data **outpkt) { krb5_int32 timenow; register krb5_kdc_replay_ent *eptr, *last, *hold; @@ -127,10 +125,8 @@ kdc_check_lookaside(inpkt, from, outpkt) already there, and can fail softly due to other weird errors. */ void -kdc_insert_lookaside(inpkt, from, outpkt) - register krb5_data *inpkt; - register const krb5_fulladdr *from; - register krb5_data *outpkt; +kdc_insert_lookaside(krb5_data *inpkt, const krb5_fulladdr *from, + krb5_data *outpkt) { register krb5_kdc_replay_ent *eptr; krb5_int32 timenow; diff --git a/src/kdc/rtest.c b/src/kdc/rtest.c index 23e88f6c1..1ae78a176 100644 --- a/src/kdc/rtest.c +++ b/src/kdc/rtest.c @@ -34,10 +34,7 @@ void krb5_klog_syslog(void); static krb5_principal -make_princ(ctx, str, prog) - krb5_context ctx; - const char *str; - const char *prog; +make_princ(krb5_context ctx, const char *str, const char *prog) { krb5_principal ret; char *dat; @@ -61,10 +58,8 @@ make_princ(ctx, str, prog) } int -main(argc,argv) - int argc; - char *argv[]; - { +main(int argc, char **argv) +{ krb5_data otrans; krb5_data ntrans; krb5_principal tgs, cl, sv; @@ -113,5 +108,5 @@ main(argc,argv) exit(0); } -void krb5_klog_syslog() {} +void krb5_klog_syslog(void) {} kdc_realm_t *find_realm_data (char *rname, krb5_ui_4 rsize) { return 0; }