From: Keith Vetter Date: Fri, 28 Apr 1995 01:18:29 +0000 (+0000) Subject: Fixes so that the Unix changes no longer breaks on the PC X-Git-Tag: krb5-1.0-beta5~165 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a82fd641101d8360c7ae3a65b5d66d4430b4f2cc;p=krb5.git Fixes so that the Unix changes no longer breaks on the PC git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5587 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index bb920ba3a..094bc56df 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,6 @@ +Thu Apr 27 17:57:36 1995 Keith Vetter (keithv@fusion.com) + + * krb5.h: krb5_mk_req somehow got INTERFACE added to it--removed it. Tue Apr 25 21:58:23 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/include/krb5.h b/src/include/krb5.h index 3a2d456aa..65b6e2686 100644 --- a/src/include/krb5.h +++ b/src/include/krb5.h @@ -1266,7 +1266,7 @@ krb5_error_code INTERFACE krb5_get_cred_via_tkt krb5_address * const *, krb5_creds *, krb5_creds **)); -krb5_error_code INTERFACE krb5_mk_req +krb5_error_code krb5_mk_req PROTOTYPE((krb5_context, krb5_auth_context **, const krb5_flags, diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index 26edc36cb..1905f2afc 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,8 @@ +Thu Apr 27 17:39:04 1995 Keith Vetter (keithv@fusion.com) + + * k5-config.h: Added MAXPATHLEN constant. + * adm_prot.h: updated prototype. + Thu Apr 27 11:24:24 1995 Keith Vetter (keithv@fusion.com) * k5-config.h: Changed over to the new single config file on the PC. diff --git a/src/include/krb5/adm_proto.h b/src/include/krb5/adm_proto.h index c515fdf8e..11bc1eb6c 100644 --- a/src/include/krb5/adm_proto.h +++ b/src/include/krb5/adm_proto.h @@ -46,7 +46,7 @@ void INTERFACE krb5_adm_disconnect /* adm_proto.c */ void INTERFACE krb5_free_adm_data PROTOTYPE((krb5_context, - int, + krb5_int32, krb5_data *)); krb5_error_code INTERFACE krb5_send_adm_cmd diff --git a/src/include/krb5/k5-config.h b/src/include/krb5/k5-config.h index a8134ca0c..a4d24c3d6 100644 --- a/src/include/krb5/k5-config.h +++ b/src/include/krb5/k5-config.h @@ -49,6 +49,7 @@ #define SIZEOF_SHORT 2 #define SIZEOF_LONG 4 #define MAXHOSTNAMELEN 512 +#define MAXPATHLEN 128 #define KRB5_USE_INET #define MSDOS_FILESYSTEM diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index cd4cf7beb..eb60c3cec 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +Thu Apr 27 17:40:20 1995 Keith Vetter (keithv@fusion.com) + + * adm_rw.c, mk_cred.c, rd_cred.c: + malloc on the PC must be size SIZE_T not int32. + * adm_rw.c: krb5_free_adm_data second argument now a krb5_int32. Thu Apr 27 16:33:17 EDT 1995 Paul Park (pjpark@mit.edu) diff --git a/src/lib/krb5/krb/adm_rw.c b/src/lib/krb5/krb/adm_rw.c index 6155f8f73..afd466d2a 100644 --- a/src/lib/krb5/krb/adm_rw.c +++ b/src/lib/krb5/krb/adm_rw.c @@ -25,6 +25,7 @@ /* * Routines to engage in the administrative (password changing) protocol. */ +#define NEED_SOCKETS #include "k5-int.h" #include "auth_con.h" #include "adm_proto.h" @@ -79,7 +80,7 @@ kadm_copyout_int32(outint, cp) void INTERFACE krb5_free_adm_data(kcontext, ncomp, datap) krb5_context kcontext; - int ncomp; + krb5_int32 ncomp; krb5_data *datap; { int i; @@ -329,12 +330,12 @@ krb5_read_adm_cmd(kcontext, sock, ctx, nargs, arglist) /* Get the memory for the list */ if (*arglist = (krb5_data *) - malloc((*nargs) * sizeof(krb5_data))) { + malloc((size_t) (*nargs) * sizeof(krb5_data))) { krb5_data *xarglist; xarglist = *arglist; - memset((char *) (xarglist), 0, - (*nargs) * sizeof(krb5_data)); + memset((char *) (xarglist), 0, + (size_t) (*nargs) * sizeof(krb5_data)); replyok = 1; /* Copy out each list entry */ @@ -454,12 +455,12 @@ krb5_read_adm_reply(kcontext, sock, ctx, cmd_stat, ncomps, complist) /* Get the memory for the list */ if (*complist = (krb5_data *) - malloc((*ncomps) * sizeof(krb5_data))) { + malloc((size_t) ((*ncomps) * sizeof(krb5_data)))) { krb5_data *xcomplist; xcomplist = *complist; memset((char *) (xcomplist), 0, - (*ncomps) * sizeof(krb5_data)); + (size_t) ((*ncomps) * sizeof(krb5_data))); replyok = 1; /* Copy out each list entry */ diff --git a/src/lib/krb5/krb/mk_cred.c b/src/lib/krb5/krb/mk_cred.c index 6b95301a3..5fbd63f39 100644 --- a/src/lib/krb5/krb/mk_cred.c +++ b/src/lib/krb5/krb/mk_cred.c @@ -8,6 +8,9 @@ * * MODIFIED * $Log$ + * Revision 5.9 1995/04/28 01:18:18 keithv + * Fixes so that the Unix changes no longer breaks on the PC. + * * Revision 5.8 1995/04/26 03:03:11 proven * * Makefile.in : Added gc_via_tkt.c and removed get_fcreds.c * * auth_con.c (krb5_auth_con_setaddrs()) : Fixed so it allocates @@ -146,14 +149,14 @@ krb5_mk_ncred_basic(context, ppcreds, nppcreds, keyblock, /* Get memory for creds and initialize it */ if ((credenc.ticket_info = (krb5_cred_info **) - malloc(sizeof(krb5_cred_info *) * (nppcreds + 1))) == NULL) { + malloc((size_t) (sizeof(krb5_cred_info *) * (nppcreds + 1)))) == NULL) { return ENOMEM; } - if ((tmp = (char *)malloc(sizeof(krb5_cred_info) * nppcreds)) == NULL) { + if ((tmp = (char *)malloc((size_t) (sizeof(krb5_cred_info) * nppcreds))) == NULL) { retval = ENOMEM; goto cleanup_info; } - memset(tmp, 0, sizeof(krb5_cred_info) * nppcreds); + memset(tmp, 0, (size_t) (sizeof(krb5_cred_info) * nppcreds)); /* * For each credential in the list, initialize a cred info diff --git a/src/lib/krb5/krb/rd_cred.c b/src/lib/krb5/krb/rd_cred.c index 179a922b7..f221d9a2e 100644 --- a/src/lib/krb5/krb/rd_cred.c +++ b/src/lib/krb5/krb/rd_cred.c @@ -126,8 +126,9 @@ krb5_rd_cred_basic(context, pcreddata, pkeyblock, local_addr, remote_addr, * krb5_free_tgt_creds can be used to free the list. */ for (ncreds = 0; pcred->tickets[ncreds]; ncreds++); + if ((*pppcreds = - (krb5_creds **)malloc(sizeof(krb5_creds *) * ncreds + 1)) == NULL) { + (krb5_creds **)malloc((size_t)(sizeof(krb5_creds *) * ncreds + 1))) == NULL) { retval = ENOMEM; goto cleanup_cred; } diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 67c27e821..513489d10 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,11 @@ +Thu Apr 27 17:50:14 1995 Keith Vetter (keithv@fusion.com) + + * adm_conn.c: added constant to pull in needed PC code, and + removed two unused variables. + * genaddrs.c: needed casts on getsockname and getpeername calls. + * mk_faddr.c: the int->byte code needed explicit casts. + * os-proto.h: added missing prototype for krb5_make_fulladdr. + Wed Apr 26 16:00:52 EDT 1995 Paul Park (pjpark@mit.edu) * Add adm_conn.c - module to provide a connection to an administrative diff --git a/src/lib/krb5/os/adm_conn.c b/src/lib/krb5/os/adm_conn.c index c036fddf7..7eb7bcb62 100644 --- a/src/lib/krb5/os/adm_conn.c +++ b/src/lib/krb5/os/adm_conn.c @@ -25,6 +25,7 @@ * Routines to contact an administrative protocol server. */ #define NEED_SOCKETS +#define NEED_LOWLEVEL_IO #include "k5-int.h" #include "adm.h" #include "adm_proto.h" @@ -208,8 +209,6 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote) struct hostent *remote_host; struct servent *service; char **hostlist; - int host_count; - int namelen; int i, count; krb5_error_code kret; diff --git a/src/lib/krb5/os/genaddrs.c b/src/lib/krb5/os/genaddrs.c index 1ca9dee01..f13ea09cf 100644 --- a/src/lib/krb5/os/genaddrs.c +++ b/src/lib/krb5/os/genaddrs.c @@ -51,7 +51,7 @@ krb5_auth_con_genaddrs(context, auth_context, fd, flags) ssize = sizeof(struct sockaddr); if ((flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) || (flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR)) { - if (retval = getsockname(fd, &saddr, &ssize)) + if (retval = getsockname(fd, (struct sockaddr *) &saddr, &ssize)) return retval; if (flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) { @@ -69,7 +69,7 @@ krb5_auth_con_genaddrs(context, auth_context, fd, flags) if ((flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) || (flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR)) { - if (retval = getpeername(fd, &saddr, &ssize)) + if (retval = getpeername(fd, (struct sockaddr *) &saddr, &ssize)) return retval; if (flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) { diff --git a/src/lib/krb5/os/mk_faddr.c b/src/lib/krb5/os/mk_faddr.c index 3d090edd8..e2256418d 100644 --- a/src/lib/krb5/os/mk_faddr.c +++ b/src/lib/krb5/os/mk_faddr.c @@ -28,13 +28,13 @@ #include "k5-int.h" #ifdef KRB5_USE_INET - + #include "os-proto.h" #ifndef _WINSOCKAPI_ #include #endif -krb5_error_code INTERFACE +krb5_error_code krb5_make_fulladdr(context, saddr, kaddr) krb5_context context; struct sockaddr_in * saddr; @@ -58,14 +58,14 @@ krb5_make_fulladdr(context, saddr, kaddr) tmp16 = ADDRTYPE_INET; *marshal++ = 0x00; *marshal++ = 0x00; - *marshal++ = tmp16 & 0xff; - *marshal++ = (tmp16 >> 8) & 0xff; + *marshal++ = (krb5_octet) (tmp16 & 0xff); + *marshal++ = (krb5_octet) ((tmp16 >> 8) & 0xff); tmp32 = sizeof(smushaddr); - *marshal++ = tmp32 & 0xff; - *marshal++ = (tmp32 >> 8) & 0xff; - *marshal++ = (tmp32 >> 16) & 0xff; - *marshal++ = (tmp32 >> 24) & 0xff; + *marshal++ = (krb5_octet) (tmp32 & 0xff); + *marshal++ = (krb5_octet) ((tmp32 >> 8) & 0xff); + *marshal++ = (krb5_octet) ((tmp32 >> 16) & 0xff); + *marshal++ = (krb5_octet) ((tmp32 >> 24) & 0xff); (void) memcpy((char *)marshal, (char *)&smushaddr, sizeof(smushaddr)); marshal += sizeof(smushaddr); @@ -73,14 +73,14 @@ krb5_make_fulladdr(context, saddr, kaddr) tmp16 = ADDRTYPE_IPPORT; *marshal++ = 0x00; *marshal++ = 0x00; - *marshal++ = tmp16 & 0xff; - *marshal++ = (tmp16 >> 8) & 0xff; + *marshal++ = (krb5_octet) (tmp16 & 0xff); + *marshal++ = (krb5_octet) ((tmp16 >> 8) & 0xff); tmp32 = sizeof(smushport); - *marshal++ = tmp32 & 0xff; - *marshal++ = (tmp32 >> 8) & 0xff; - *marshal++ = (tmp32 >> 16) & 0xff; - *marshal++ = (tmp32 >> 24) & 0xff; + *marshal++ = (krb5_octet) (tmp32 & 0xff); + *marshal++ = (krb5_octet) ((tmp32 >> 8) & 0xff); + *marshal++ = (krb5_octet) ((tmp32 >> 16) & 0xff); + *marshal++ = (krb5_octet) ((tmp32 >> 24) & 0xff); (void) memcpy((char *)marshal, (char *)&smushport, sizeof(smushport)); marshal += sizeof(smushport); diff --git a/src/lib/krb5/os/os-proto.h b/src/lib/krb5/os/os-proto.h index e73610d5f..895923c38 100644 --- a/src/lib/krb5/os/os-proto.h +++ b/src/lib/krb5/os/os-proto.h @@ -48,6 +48,12 @@ krb5_error_code krb5_make_full_ipaddr int, /* unsigned short promotes to signed int */ krb5_address **)); + +krb5_error_code krb5_make_fulladdr + PROTOTYPE((krb5_context, + struct sockaddr_in *, + krb5_address *)); + #endif /* KRB5_USE_INET */ #endif /* KRB5_LIBOS_INT_PROTO__ */