[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can we get rid of kerb5 redefining macros?



Hi,

FreeBSD 5-CURRENT switched Basic Socket Interface Extensions for IPv6
from RFC 2553 to RFC 3493 (aka RFC 2553bis).  This obsoleted
EAI_ADDRFAMILY and EAI_NODATA.  Now, EAI_* in our netdb.h is
following:

#if 0
/* obsoleted */
#define	EAI_ADDRFAMILY	 1	/* address family for hostname not supported */
#endif
#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 */
#if 0
/* obsoleted */
#define	EAI_NODATA	 7	/* no address associated with hostname */
#endif
#define	EAI_NONAME	 8	/* hostname nor servname provided, or not known */
#define	EAI_NODATA	EAI_NONAME	/* to be removed on 23 Apr 2004 */
#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 */
#define	EAI_BADHINTS	12
#define	EAI_PROTOCOL	13
#define	EAI_MAX		14

Unfortunately, heimdal referes EAI_ADDRFAMILY and EAI_NODATA, and is
affected this change.  The following patch corresponds to this change.
Could you please apply it to heimdal?
Sorry but the diff is against heimdal in FreeBSD 5.2-BETA.

Sincerely,

Index: heimdal/lib/krb5/eai_to_heim_errno.c
diff -u heimdal/lib/krb5/eai_to_heim_errno.c.orig heimdal/lib/krb5/eai_to_heim_errno.c
--- heimdal/lib/krb5/eai_to_heim_errno.c.orig	Thu Jun 21 11:11:31 2001
+++ heimdal/lib/krb5/eai_to_heim_errno.c	Fri Nov  7 02:47:15 2003
@@ -47,8 +47,10 @@
     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:
@@ -59,8 +61,10 @@
 	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: heimdal/lib/krb5/verify_krb5_conf.c
diff -u heimdal/lib/krb5/verify_krb5_conf.c.orig heimdal/lib/krb5/verify_krb5_conf.c
--- heimdal/lib/krb5/verify_krb5_conf.c.orig	Sat Oct 25 06:55:43 2003
+++ heimdal/lib/krb5/verify_krb5_conf.c	Fri Nov  7 02:42:26 2003
@@ -156,7 +156,11 @@
     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: heimdal/lib/roken/roken-common.h
diff -u heimdal/lib/roken/roken-common.h.orig heimdal/lib/roken/roken-common.h
--- heimdal/lib/roken/roken-common.h.orig	Wed Sep 18 02:36:32 2002
+++ heimdal/lib/roken/roken-common.h	Fri Nov  7 01:58:38 2003
@@ -171,22 +171,26 @@
 #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 @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@bisd.hitachi.co.jp  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/