+2001-07-31 Ezra Peisach <epeisach@mit.edu>
+
+ * genaddrs.c: Use GETPEERNAME_ARG2_TYPE, GETPEERNAME_ARG3_TYPE
+ instead of assuming types.
+
+ * changepw.c: Use GETSOCKNAME_ARG3_TYPE instead of int in casts.
+
2001-07-26 Ezra Peisach <epeisach@mit.edu>
* gen_port.c (krb5_gen_portaddr): Add const to cast of
#endif
#endif /* _WIN32 && !__CYGWIN32__ */
+#ifndef GETSOCKNAME_ARG3_TYPE
+#define GETSOCKNAME_ARG3_TYPE int
+#endif
+
/*
* Wrapper function for the two backends
*/
krb5_address local_kaddr, remote_kaddr;
char *code_string;
krb5_error_code code = 0;
- int i, addrlen;
+ int i;
+ GETSOCKNAME_ARG3_TYPE addrlen;
struct sockaddr_storage local_addr, remote_addr, tmp_addr;
- int cc, local_result_code, tmp_len;
+ int cc, local_result_code;
+ /* platforms seem to be consistant and use the same types */
+ GETSOCKNAME_ARG3_TYPE tmp_len;
SOCKET s1 = INVALID_SOCKET, s2 = INVALID_SOCKET;
int tried_one = 0;
struct addrlist al = ADDRLIST_INIT;
goto cleanup;
}
- if ((cc = sendto(s1, chpw_req.data, (int) chpw_req.length, 0,
+ if ((cc = sendto(s1, chpw_req.data,
+ (GETSOCKNAME_ARG3_TYPE) chpw_req.length, 0,
al.addrs[i], socklen(al.addrs[i]))) != chpw_req.length)
{
if ((cc < 0) && ((SOCKET_ERRNO == ECONNREFUSED) ||
SunOS 4.1.4 or Irix 5.3. Thus we must actually accept the
value and discard it. */
tmp_len = sizeof(tmp_addr);
- if ((cc = recvfrom(s1, chpw_rep.data, (int) chpw_rep.length,
+ if ((cc = recvfrom(s1, chpw_rep.data,
+ (GETSOCKNAME_ARG3_TYPE) chpw_rep.length,
0, ss2sa(&tmp_addr), &tmp_len)) < 0)
{
code = SOCKET_ERRNO;
#include <netinet/in.h>
#endif
+#ifndef GETPEERNAME_ARG2_TYPE
+#define GETPEERNAME_ARG2_TYPE struct sockaddr
+#endif
+#ifndef GETPEERNAME_ARG3_TYPE
+#define GETPEERNAME_ARG3_TYPE size_t
+#endif
+#ifndef GETSOCKNAME_ARG2_TYPE
+#define GETSOCKNAME_ARG2_TYPE struct sockaddr
+#endif
+#ifndef GETSOCKNAME_ARG3_TYPE
+#define GETSOCKNAME_ARG3_TYPE size_t
+#endif
+
KRB5_DLLIMP krb5_error_code KRB5_CALLCONV
krb5_auth_con_genaddrs(context, auth_context, infd, flags)
krb5_context context;
struct sockaddr_in lsaddr, rsaddr;
krb5_address lcaddr, rcaddr;
krb5_address lcport, rcport;
- int ssize;
+ GETSOCKNAME_ARG3_TYPE ssize;
ssize = sizeof(struct sockaddr);
if ((flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) ||
(flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR)) {
- if ((retval = getsockname(fd, (struct sockaddr *) &lsaddr, &ssize)))
+ if ((retval = getsockname(fd, (GETSOCKNAME_ARG2_TYPE *) &lsaddr,
+ &ssize)))
return retval;
if (flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) {
if ((flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) ||
(flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR)) {
- if ((retval = getpeername(fd, (struct sockaddr *) &rsaddr, &ssize)))
+ if ((retval = getpeername(fd, (GETPEERNAME_ARG2_TYPE *) &rsaddr,
+ &ssize)))
return retval;
if (flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) {