Re: Can we get rid of kerb5 redefining macros?

From: Hajimu UMEMOTO <ume_at_mahoroba.org>
Date: Mon, 01 Dec 2003 21:47:04 +0900
Hi,

>>>>> On Mon, 1 Dec 2003 04:11:34 -0800
>>>>> "David O'Brien" <obrien_at_freebsd.org> said:

obrien> Ever since kerberos5 got hooked up to the build by default I'm getting
obrien> *TONS* (758) of CPP macros.  An example is:

obrien> In file included from /usr/obj/usr/src/kerberos5/lib/libasn1/roken.h:77,
obrien>                  from /usr/src/crypto/heimdal/lib/vers/print_version.c:38:
obrien> /usr/src/crypto/heimdal/lib/roken/roken-common.h:183:1: warning: "EAI_NODATA" re
obrien> defined
obrien> In file included from /usr/obj/usr/src/kerberos5/lib/libasn1/roken.h:59,
obrien>                  from /usr/src/crypto/heimdal/lib/vers/print_version.c:38:
obrien> /usr/include/netdb.h:166:1: warning: this is the location of the previous defini
obrien> tion

obrien> Can a kerberos5 guy take a look at these?

I made a patch for this.  However, I forgot to sent it to Kerberos5
guy.

Sincerely,

Index: crypto/heimdal/lib/krb5/eai_to_heim_errno.c
diff -u crypto/heimdal/lib/krb5/eai_to_heim_errno.c.orig crypto/heimdal/lib/krb5/eai_to_heim_errno.c
--- crypto/heimdal/lib/krb5/eai_to_heim_errno.c.orig	Thu Jun 21 11:11:31 2001
+++ crypto/heimdal/lib/krb5/eai_to_heim_errno.c	Fri Nov  7 02:47:15 2003
_at__at_ -47,8 +47,10 _at__at_
     switch(eai_errno) {
     case EAI_NOERROR:
 	return 0;
+#ifdef EAI_ADDRFAMILY
     case EAI_ADDRFAMILY:
 	return HEIM_EAI_ADDRFAMILY;
+#endif
     case EAI_AGAIN:
 	return HEIM_EAI_AGAIN;
     case EAI_BADFLAGS:
_at__at_ -59,8 +61,10 _at__at_
 	return HEIM_EAI_FAMILY;
     case EAI_MEMORY:
 	return HEIM_EAI_MEMORY;
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
     case EAI_NODATA:
 	return HEIM_EAI_NODATA;
+#endif
     case EAI_NONAME:
 	return HEIM_EAI_NONAME;
     case EAI_SERVICE:
Index: crypto/heimdal/lib/krb5/verify_krb5_conf.c
diff -u crypto/heimdal/lib/krb5/verify_krb5_conf.c.orig crypto/heimdal/lib/krb5/verify_krb5_conf.c
--- crypto/heimdal/lib/krb5/verify_krb5_conf.c.orig	Sat Oct 25 06:55:43 2003
+++ crypto/heimdal/lib/krb5/verify_krb5_conf.c	Fri Nov  7 02:42:26 2003
_at__at_ -156,7 +156,11 _at__at_
     hostname[strcspn(hostname, "/")] = '\0';
     ret = getaddrinfo(hostname, "telnet" /* XXX */, NULL, &ai);
     if(ret != 0) {
+#ifdef EAI_NODATA
 	if(ret == EAI_NODATA)
+#else
+	if(ret == EAI_NONAME)
+#endif
 	    krb5_warnx(context, "%s: host not found (%s)", path, hostname);
 	else
 	    krb5_warnx(context, "%s: %s (%s)", path, gai_strerror(ret), hostname);
Index: crypto/heimdal/lib/roken/roken-common.h
diff -u crypto/heimdal/lib/roken/roken-common.h.orig crypto/heimdal/lib/roken/roken-common.h
--- crypto/heimdal/lib/roken/roken-common.h.orig	Wed Sep 18 02:36:32 2002
+++ crypto/heimdal/lib/roken/roken-common.h	Fri Nov  7 01:58:38 2003
_at__at_ -171,22 +171,26 _at__at_
 #ifndef EAI_NOERROR
 #define EAI_NOERROR	0	/* no error */
 #endif
-
 #ifndef EAI_ADDRFAMILY
-
 #define EAI_ADDRFAMILY	1	/* address family for nodename not supported */
+#endif
+
+#ifndef EAI_NONAME
+
 #define EAI_AGAIN	2	/* temporary failure in name resolution */
 #define EAI_BADFLAGS	3	/* invalid value for ai_flags */
 #define EAI_FAIL	4	/* non-recoverable failure in name resolution */
 #define EAI_FAMILY	5	/* ai_family not supported */
 #define EAI_MEMORY	6	/* memory allocation failure */
+#ifndef EAI_NODATA
 #define EAI_NODATA	7	/* no address associated with nodename */
+#endif
 #define EAI_NONAME	8	/* nodename nor servname provided, or not known */
 #define EAI_SERVICE	9	/* servname not supported for ai_socktype */
 #define EAI_SOCKTYPE   10	/* ai_socktype not supported */
 #define EAI_SYSTEM     11	/* system error returned in errno */
 
-#endif /* EAI_ADDRFAMILY */
+#endif /* EAI_NONAME */
 
 /* flags for getaddrinfo() */
 
--
Hajimu UMEMOTO _at_ Internet Mutual Aid Society Yokohama, Japan
ume_at_mahoroba.org  ume_at_bisd.hitachi.co.jp  ume_at_{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Received on Mon Dec 01 2003 - 03:47:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:32 UTC