From: Richard Basch Date: Fri, 7 Feb 1997 19:27:28 +0000 (+0000) Subject: copy_addrs.c fwd_tgt.c mk_cred.c sendauth.c: Added FAR declarations X-Git-Tag: krb5-1.1-beta1~1365 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5cf10c92cd9e53eedccbf37cda85f3087942cf27;p=krb5.git copy_addrs.c fwd_tgt.c mk_cred.c sendauth.c: Added FAR declarations mk_cred.c: Declare ncreds as krb5_int32 so that the right type will be passed to krb5_mk_ncred_basic (win16 fix) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9815 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 1d6f06b85..356e96521 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,15 @@ +Fri Feb 7 09:41:33 1997 Richard Basch + + * mk_cred.c (krb5_mk_ncred): Declare ncred as krb5_int32 so that + the right value is pushed onto the stack when calling + krb5_mk_ncred_basic() + + * copy_addrs.c fwd_tgt.c mk_cred.c: + Use FAR keyword in pointer declarations. + + * sendauth.c (krb5_sendauth): Do not free the credentials if they + are being returned to the caller [krb5-libs/357] + Sun Feb 2 20:57:15 1997 Richard Basch * serialize.c: Added FAR declarations to pointer arguments for diff --git a/src/lib/krb5/krb/copy_addrs.c b/src/lib/krb5/krb/copy_addrs.c index 596a1267e..fa2d36723 100644 --- a/src/lib/krb5/krb/copy_addrs.c +++ b/src/lib/krb5/krb/copy_addrs.c @@ -32,9 +32,9 @@ krb5_copy_addr(context, inad, outad) const krb5_address FAR *inad; krb5_address FAR * FAR *outad; { - krb5_address *tmpad; + krb5_address FAR *tmpad; - if (!(tmpad = (krb5_address *)malloc(sizeof(*tmpad)))) + if (!(tmpad = (krb5_address FAR *)malloc(sizeof(*tmpad)))) return ENOMEM; #ifdef HAVE_C_STRUCTURE_ASSIGNMENT *tmpad = *inad; diff --git a/src/lib/krb5/krb/fwd_tgt.c b/src/lib/krb5/krb/fwd_tgt.c index ed95b75fd..de4b5f93d 100644 --- a/src/lib/krb5/krb/fwd_tgt.c +++ b/src/lib/krb5/krb/fwd_tgt.c @@ -42,11 +42,11 @@ krb5_fwd_tgt_creds(context, auth_context, rhost, client, server, cc, krb5_data FAR *outbuf; { krb5_replay_data replaydata; - krb5_data * scratch = 0; - krb5_address **addrs = 0; + krb5_data FAR * scratch = 0; + krb5_address FAR * FAR *addrs = 0; krb5_error_code retval; krb5_creds creds, tgt; - krb5_creds *pcreds; + krb5_creds FAR *pcreds; krb5_flags kdcoptions; int close_cc = 0; int free_rhost = 0; diff --git a/src/lib/krb5/krb/mk_cred.c b/src/lib/krb5/krb/mk_cred.c index 7640e7a28..23545fb61 100644 --- a/src/lib/krb5/krb/mk_cred.c +++ b/src/lib/krb5/krb/mk_cred.c @@ -109,14 +109,14 @@ clean_scratch: static krb5_error_code krb5_mk_ncred_basic(context, ppcreds, nppcreds, keyblock, replaydata, local_addr, remote_addr, pcred) - krb5_context context; - krb5_creds ** ppcreds; - krb5_int32 nppcreds; - krb5_keyblock * keyblock; - krb5_replay_data * replaydata; - krb5_address * local_addr; - krb5_address * remote_addr; - krb5_cred * pcred; + krb5_context context; + krb5_creds FAR * FAR * ppcreds; + krb5_int32 nppcreds; + krb5_keyblock FAR * keyblock; + krb5_replay_data FAR * replaydata; + krb5_address FAR * local_addr; + krb5_address FAR * remote_addr; + krb5_cred FAR * pcred; { krb5_cred_enc_part credenc; krb5_error_code retval; @@ -135,8 +135,8 @@ krb5_mk_ncred_basic(context, ppcreds, nppcreds, keyblock, credenc.timestamp = replaydata->timestamp; /* Get memory for creds and initialize it */ - size = sizeof(krb5_cred_info *) * (nppcreds + 1); - credenc.ticket_info = (krb5_cred_info **) malloc(size); + size = sizeof(krb5_cred_info FAR *) * (nppcreds + 1); + credenc.ticket_info = (krb5_cred_info FAR * FAR *) malloc(size); if (credenc.ticket_info == NULL) return ENOMEM; memset(credenc.ticket_info, 0, size); @@ -207,15 +207,15 @@ krb5_mk_ncred(context, auth_context, ppcreds, ppdata, outdata) krb5_data FAR * FAR * ppdata; krb5_replay_data FAR * outdata; { - krb5_address * premote_fulladdr = NULL; - krb5_address * plocal_fulladdr = NULL; + krb5_address FAR * premote_fulladdr = NULL; + krb5_address FAR * plocal_fulladdr = NULL; krb5_address remote_fulladdr; krb5_address local_fulladdr; - krb5_error_code retval; - krb5_keyblock * keyblock; - krb5_replay_data replaydata; - krb5_cred * pcred; - int ncred; + krb5_error_code retval; + krb5_keyblock FAR * keyblock; + krb5_replay_data replaydata; + krb5_cred FAR * pcred; + krb5_int32 ncred; local_fulladdr.contents = 0; remote_fulladdr.contents = 0; @@ -235,11 +235,11 @@ krb5_mk_ncred(context, auth_context, ppcreds, ppdata, outdata) memset(pcred, 0, sizeof(krb5_cred)); if ((pcred->tickets - = (krb5_ticket **)malloc(sizeof(krb5_ticket *) * (ncred + 1))) == NULL) { + = (krb5_ticket FAR * FAR *)malloc(sizeof(krb5_ticket FAR *) * (ncred + 1))) == NULL) { retval = ENOMEM; free(pcred); } - memset(pcred->tickets, 0, sizeof(krb5_ticket *) * (ncred +1)); + memset(pcred->tickets, 0, sizeof(krb5_ticket FAR *) * (ncred +1)); /* Get keyblock */ if ((keyblock = auth_context->local_subkey) == NULL) @@ -355,9 +355,9 @@ krb5_mk_1cred(context, auth_context, pcreds, ppdata, outdata) krb5_replay_data FAR * outdata; { krb5_error_code retval; - krb5_creds **ppcreds; + krb5_creds FAR * FAR *ppcreds; - if ((ppcreds = (krb5_creds **)malloc(sizeof(*ppcreds) * 2)) == NULL) { + if ((ppcreds = (krb5_creds FAR * FAR *)malloc(sizeof(*ppcreds) * 2)) == NULL) { return ENOMEM; } diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index 54a9ac000..348094c7c 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -60,8 +60,8 @@ krb5_sendauth(context, auth_context, { krb5_octet result; krb5_creds creds; - krb5_creds * credsp = NULL; - krb5_creds * credspout = NULL; + krb5_creds FAR * credsp = NULL; + krb5_creds FAR * credspout = NULL; krb5_error_code retval = 0; krb5_data inbuf, outbuf; int len; @@ -218,7 +218,7 @@ krb5_sendauth(context, auth_context, error_return: krb5_free_cred_contents(context, &creds); - if (credspout) + if (!out_creds && credspout) krb5_free_creds(context, credspout); if (!ccache && use_ccache) krb5_cc_close(context, use_ccache);