From: John Gilmore Date: Sat, 18 Mar 1995 03:55:46 +0000 (+0000) Subject: * Makefile.in (check-mac): Add. X-Git-Tag: krb5-1.0-beta5~525 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5a3f1edbfc02aad85349020d459165eeaa40a848;p=krb5.git * Makefile.in (check-mac): Add. * compat_recv.c, get_fcreds.c, recvauth.c: Eliminate Unix socket #includes, which are now handled by k5-int.h (via k5-config.h). * conv_princ.c: Rename variable "comp" to another name; "comp" apparently bothers the MPW compiler... * rd_cred.c: Avoid (void) casts of void functions, for MPW. * t_walk_rtree.c: Put com_err.h after k5_int for stuff. (main): Declare and initialize the krb5_context that's being passed to everything. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5164 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 6d3e670c5..0bd337cbf 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,14 @@ +Fri Mar 17 19:48:07 1995 John Gilmore (gnu at toad.com) + + * Makefile.in (check-mac): Add. + * compat_recv.c, get_fcreds.c, recvauth.c: Eliminate Unix socket + #includes, which are now handled by k5-int.h (via k5-config.h). + * conv_princ.c: Rename variable "comp" to another name; "comp" + apparently bothers the MPW compiler... + * rd_cred.c: Avoid (void) casts of void functions, for MPW. + * t_walk_rtree.c: Put com_err.h after k5_int for stuff. + (main): Declare and initialize the krb5_context that's being + passed to everything. Fri Mar 10 10:58:59 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/lib/krb5/krb/Makefile.in b/src/lib/krb5/krb/Makefile.in index 429d2b9cd..9407ee57e 100644 --- a/src/lib/krb5/krb/Makefile.in +++ b/src/lib/krb5/krb/Makefile.in @@ -1,5 +1,4 @@ CFLAGS = $(CCOPTS) $(DEFS) -LDFLAGS = -g ##DOSBUILDTOP = ..\..\.. ##DOSLIBNAME=..\krb5.lib @@ -152,6 +151,7 @@ TEST_PROGS= t_walk_rtree check:: check-$(WHAT) check-unix:: $(TEST_PROGS) +check-mac:: $(TEST_PROGS) check-windows:: diff --git a/src/lib/krb5/krb/compat_recv.c b/src/lib/krb5/krb/compat_recv.c index cb7d4b7b0..8b245ff53 100644 --- a/src/lib/krb5/krb/compat_recv.c +++ b/src/lib/krb5/krb/compat_recv.c @@ -42,10 +42,6 @@ #include #include -#ifndef _WINSOCKAPI_ -#include -#include -#endif static int krb_v4_recvauth(); diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 770df77d2..e1b90c927 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -108,27 +108,27 @@ krb5_524_conv_principal(context, princ, name, inst, realm) char *realm; { struct krb_convert *p; - krb5_data *comp; + krb5_data *compo; char *c; *name = *inst = '\0'; switch (krb5_princ_size(context, princ)) { case 2: /* Check if this principal is listed in the table */ - comp = krb5_princ_component(context, princ, 0); + compo = krb5_princ_component(context, princ, 0); p = sconv_list; while (p->v4_str) { - if (strncmp(p->v5_str, comp->data, comp->length) == 0) { + if (strncmp(p->v5_str, compo->data, compo->length) == 0) { /* It is, so set the new name now, and chop off */ /* instance's domain name if requested */ strcpy(name, p->v4_str); if (p->flags & DO_REALM_CONVERSION) { - comp = krb5_princ_component(context, princ, 1); - c = strnchr(comp->data, '.', comp->length); - if (!c || (c - comp->data) > INST_SZ - 1) + compo = krb5_princ_component(context, princ, 1); + c = strnchr(compo->data, '.', compo->length); + if (!c || (c - compo->data) > INST_SZ - 1) return KRB5_INVALID_PRINCIPAL; - strncpy(inst, comp->data, c - comp->data); - inst[c - comp->data] = '\0'; + strncpy(inst, compo->data, c - compo->data); + inst[c - compo->data] = '\0'; } break; } @@ -137,32 +137,32 @@ krb5_524_conv_principal(context, princ, name, inst, realm) /* If inst isn't set, the service isn't listed in the table, */ /* so just copy it. */ if (*inst == '\0') { - comp = krb5_princ_component(context, princ, 1); - if (comp->length >= INST_SZ - 1) + compo = krb5_princ_component(context, princ, 1); + if (compo->length >= INST_SZ - 1) return KRB5_INVALID_PRINCIPAL; - strncpy(inst, comp->data, comp->length); - inst[comp->length] = '\0'; + strncpy(inst, compo->data, compo->length); + inst[compo->length] = '\0'; } /* fall through */ case 1: /* name may have been set above; otherwise, just copy it */ if (*name == '\0') { - comp = krb5_princ_component(context, princ, 0); - if (comp->length >= ANAME_SZ) + compo = krb5_princ_component(context, princ, 0); + if (compo->length >= ANAME_SZ) return KRB5_INVALID_PRINCIPAL; - strncpy(name, comp->data, comp->length); - name[comp->length] = '\0'; + strncpy(name, compo->data, compo->length); + name[compo->length] = '\0'; } break; default: return KRB5_INVALID_PRINCIPAL; } - comp = krb5_princ_realm(context, princ); - if (comp->length > REALM_SZ - 1) + compo = krb5_princ_realm(context, princ); + if (compo->length > REALM_SZ - 1) return KRB5_INVALID_PRINCIPAL; - strncpy(realm, comp->data, comp->length); - realm[comp->length] = '\0'; + strncpy(realm, compo->data, compo->length); + realm[compo->length] = '\0'; return 0; } diff --git a/src/lib/krb5/krb/get_fcreds.c b/src/lib/krb5/krb/get_fcreds.c index cb6cbd96d..e0a263049 100644 --- a/src/lib/krb5/krb/get_fcreds.c +++ b/src/lib/krb5/krb/get_fcreds.c @@ -33,10 +33,6 @@ #define NEED_SOCKETS #include "k5-int.h" #include -#ifndef _WINSOCKAPI_ -#include -#include -#endif #define KRB5_DEFAULT_LIFE 60*60*8 /* 8 hours */ /* helper function: convert flags to necessary KDC options */ diff --git a/src/lib/krb5/krb/rd_cred.c b/src/lib/krb5/krb/rd_cred.c index d82868bb1..d8212e555 100644 --- a/src/lib/krb5/krb/rd_cred.c +++ b/src/lib/krb5/krb/rd_cred.c @@ -57,14 +57,20 @@ krb5_rd_cred(context, inbuf, key, creds, sender_addr, recv_addr) return retval; } -#define cleanup_credmsg() {(void)krb5_xfree(credmsg->enc_part.ciphertext.data); (void)krb5_xfree(credmsg);} +#define cleanup_credmsg() { \ + krb5_xfree(credmsg->enc_part.ciphertext.data); \ + krb5_xfree(credmsg); \ + } if (!(scratch = (krb5_data *) malloc(sizeof(*scratch)))) { cleanup_credmsg(); return ENOMEM; } -#define cleanup_scratch() {(void)memset(scratch->data, 0, scratch->length); (void)krb5_xfree(scratch->data);} +#define cleanup_scratch() { \ + (void)memset(scratch->data, 0, scratch->length); \ + krb5_xfree(scratch->data); \ + } if (retval = encode_krb5_ticket(credmsg->tickets[0], &scratch)) { cleanup_credmsg(); @@ -132,7 +138,7 @@ krb5_rd_cred(context, inbuf, key, creds, sender_addr, recv_addr) } cleanup_scratch(); -#define cleanup_mesg() {(void)krb5_xfree(credmsg_enc_part);} +#define cleanup_mesg() {krb5_xfree(credmsg_enc_part);} if (retval = krb5_timeofday(context, ¤ttime)) { cleanup_mesg(); diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c index edfc5ba5b..8b1e832e6 100644 --- a/src/lib/krb5/krb/recvauth.c +++ b/src/lib/krb5/krb/recvauth.c @@ -24,18 +24,12 @@ * convenience sendauth/recvauth functions */ - #define NEED_SOCKETS #include "k5-int.h" - #include "com_err.h" #include - #include #include -#ifndef _WINSOCKAPI_ -#include -#endif extern krb5_flags krb5_kdc_default_options; diff --git a/src/lib/krb5/krb/t_walk_rtree.c b/src/lib/krb5/krb/t_walk_rtree.c index 419c4137e..88ca4e1ee 100644 --- a/src/lib/krb5/krb/t_walk_rtree.c +++ b/src/lib/krb5/krb/t_walk_rtree.c @@ -3,8 +3,8 @@ */ #include -#include "com_err.h" #include "k5-int.h" +#include "com_err.h" main(argc, argv) int argc; @@ -15,7 +15,9 @@ main(argc, argv) krb5_principal *tree, *p; char *name; krb5_error_code retval; + krb5_context context; + krb5_init_context(&context); krb5_init_ets(context); if (argc < 3 && argc > 4) {