NetBSD Problem Report #12876
Received: (qmail 3706 invoked from network); 8 May 2001 21:42:33 -0000
Message-Id: <20010508212620.C1C4ABE@proven.weird.com>
Date: Tue, 8 May 2001 17:26:20 -0400 (EDT)
From: woods@weird.com (Greg A. Woods)
Reply-To: woods@weird.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org
Subject: NetBSD's INET6 patches to Postfix break non-INET6 features!
X-Send-Pr-Version: 3.95
>Number: 12876
>Category: bin
>Synopsis: NetBSD's INET6 patches to Postfix break non-INET6 features!
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 08 21:43:00 +0000 2001
>Closed-Date: Mon May 14 17:37:18 +0000 2001
>Last-Modified: Mon May 14 21:40:01 +0000 2001
>Originator: Greg A. Woods
>Release: 2001/03/24
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD proven 1.5T NetBSD 1.5T (PROVEN) #6: Mon Apr 23 00:31:12 EDT 2001 woods@proven:/work/woods/NetBSD-src/sys/arch/i386/compile/PROVEN i386
Architecture: i386
Machine: i386
>Description:
suddenly as I added smtpd_client_restrictions to my postfix
configuration, connections for many hosts were rejected even
though they should not have been!
the bug turns out not to be in Postfix, but rather in the
NetBSD-specific changes to Postfix!
>How-To-Repeat:
try enabling "smtpd_client_restrictions = reject_unknown_client"
also set "smtpd_reject_delay = no" for best effect
connect to the test postfix from a machine with a ``long''
hostname.... (more than 17 characters will do fine)
after finally finding the right place, and after finally
realising that I'm not compiling with -DINET6, examine the
source and note that some of the NetBSD changes to code around
gethostbyaddr() and gethostbyname() are really quite wrong and
may not have been fully tested.
>Fix:
I've not yet examined the new version of NetBSD version of
Postfix that should be arriving tomorrow in my rsync from
cvs.netbsd.org, but I'm guessing these bugs still exist...
Note that it's really really really important to identify
modified versions of third-party software, especially when they
(can) announce their release names to the world!!!!
[Note: freebie included -- proper support for getdomainname()]
[Also note: I have not tested compiling with INET6....]
Index: src/global/mail_params.c
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/global/mail_params.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 mail_params.c
*** src/global/mail_params.c 2001/03/25 06:59:01 1.1.1.1
--- src/global/mail_params.c 2001/05/07 20:27:10
***************
*** 105,110 ****
--- 105,111 ----
#include <msg.h>
#include <msg_syslog.h>
#include <get_hostname.h>
+ #include <get_domainname.h>
#include <valid_hostname.h>
#include <stringops.h>
***************
*** 180,185 ****
--- 181,188 ----
/* check_myhostname - lookup hostname and validate */
+ /* XXX this code is duplicated in ../postconf/postconf.c!!! */
+
static const char *check_myhostname(void)
{
static const char *name;
***************
*** 197,204 ****
* contents of $mydomain.
*/
name = get_hostname();
if ((dot = strchr(name, '.')) == 0) {
! if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0)
msg_fatal("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf",
name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir);
name = concatenate(name, ".", domain, (char *) 0);
--- 200,211 ----
* contents of $mydomain.
*/
name = get_hostname();
+ domain = mail_conf_lookup_eval(VAR_MYDOMAIN);
+ if (!domain) {
+ domain = get_domainname();
+ }
if ((dot = strchr(name, '.')) == 0) {
! if (domain == 0)
msg_fatal("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf",
name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir);
name = concatenate(name, ".", domain, (char *) 0);
***************
*** 208,224 ****
/* check_mydomainname - lookup domain name and validate */
static const char *check_mydomainname(void)
{
! char *dot;
! /*
! * Use the hostname when it is not a FQDN ("foo"), or when the hostname
! * actually is a domain name ("foo.com").
! */
! if ((dot = strchr(var_myhostname, '.')) == 0 || strchr(dot + 1, '.') == 0)
! return (var_myhostname);
! return (dot + 1);
}
/* check_default_privs - lookup default user attributes and validate */
--- 215,230 ----
/* check_mydomainname - lookup domain name and validate */
+ /* XXX this code is duplicated in ../postconf/postconf.c!!! */
+
static const char *check_mydomainname(void)
{
! const char *name;
! if ((name = get_domainname()) == 0) {
! name = mail_conf_lookup_eval(VAR_MYDOMAIN);
! }
! return name;
}
/* check_default_privs - lookup default user attributes and validate */
Index: src/global/mail_version.h
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/global/mail_version.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 mail_version.h
*** src/global/mail_version.h 2001/03/25 06:59:02 1.1.1.1
--- src/global/mail_version.h 2001/05/08 19:07:38
***************
*** 15,21 ****
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
! #define DEF_MAIL_VERSION "Release-20010228"
extern char *var_mail_version;
/* LICENSE
--- 15,25 ----
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
! #ifdef INET6
! # define DEF_MAIL_VERSION "Release-20010228-NetBSD-INET6"
! #else
! # define DEF_MAIL_VERSION "Release-20010228-NetBSD"
! #endif
extern char *var_mail_version;
/* LICENSE
Index: src/global/peer_name.c
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/global/peer_name.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 peer_name.c
*** src/global/peer_name.c 2001/03/25 06:59:02 1.1.1.1
--- src/global/peer_name.c 2001/05/08 20:47:15
***************
*** 60,94 ****
/* Utility library. */
#include <msg.h>
#include <valid_hostname.h>
#include <peer_name.h>
/* peer_name - produce printable peer name and address */
PEER_NAME *peer_name(int sock)
{
static PEER_NAME peer;
union sockunion {
- struct {
- u_char si_len;
- u_char si_family;
- u_short si_port;
- } su_si;
struct sockaddr peer_un;
struct sockaddr_in peer_un4;
#ifdef INET6
struct sockaddr_in6 peer_un6;
#endif
} p_un;
! #define sun p_un.peer_un
#define sin p_un.peer_un4
#ifdef INET6
#define sin6 p_un.peer_un6
static char hbuf[NI_MAXHOST];
! static char abuf[NI_MAXHOST];
#else
struct hostent *hp;
#endif
SOCKADDR_SIZE len = sizeof(p_un);
--- 60,107 ----
/* Utility library. */
+ #include <mymalloc.h>
#include <msg.h>
#include <valid_hostname.h>
#include <peer_name.h>
+ #ifdef INET6
+ static char *
+ streiaret(eia, err)
+ int eia;
+ int err;
+ {
+ switch (eia) {
+ case EAI_SYSTEM:
+ return strerror(err);
+ default:
+ return gai_strerror(err);
+ }
+ }
+ #endif
+
/* peer_name - produce printable peer name and address */
PEER_NAME *peer_name(int sock)
{
static PEER_NAME peer;
union sockunion {
struct sockaddr peer_un;
struct sockaddr_in peer_un4;
#ifdef INET6
struct sockaddr_in6 peer_un6;
#endif
} p_un;
! #define sa p_un.peer_un
#define sin p_un.peer_un4
#ifdef INET6
#define sin6 p_un.peer_un6
+ int eia;
static char hbuf[NI_MAXHOST];
! static char abuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")+1];
#else
struct hostent *hp;
+ static char abuf[sizeof("255.255.255.255")+1];
#endif
SOCKADDR_SIZE len = sizeof(p_un);
***************
*** 97,124 ****
#ifndef INET6
case AF_INET:
peer.type = PEER_TYPE_INET;
hp = gethostbyaddr((char *) &(sin.sin_addr),
sizeof(sin.sin_addr), AF_INET);
! peer.name = (hp && valid_hostname(hp->h_name, DO_GRIPE) ?
! hp->h_name : "unknown");
! peer.addr = inet_ntoa(sin.sin_addr);
return (&peer);
#else
case AF_INET:
peer.type = PEER_TYPE_INET;
! if (getnameinfo(&sun, len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) != 0)
peer.name = "unknown";
! else
peer.name = hbuf;
- peer.addr = abuf;
return (&peer);
case AF_INET6:
peer.type = PEER_TYPE_INET6;
! if (getnameinfo(&sun, len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) != 0)
peer.name = "unknown";
! else
peer.name = hbuf;
- peer.addr = abuf;
return (&peer);
#endif
case AF_UNSPEC:
--- 110,192 ----
#ifndef INET6
case AF_INET:
peer.type = PEER_TYPE_INET;
+ strcpy(abuf, inet_ntoa(sin.sin_addr));
+ peer.addr = abuf;
+ msg_info("DNS query from peer_name: gethostbyaddr(%s): %s", peer.addr);
hp = gethostbyaddr((char *) &(sin.sin_addr),
sizeof(sin.sin_addr), AF_INET);
! if (!hp) {
! switch (h_errno) {
! case HOST_NOT_FOUND:
! if (msg_verbose)
! msg_info("gethostbyaddr(%s): %s", peer.addr, hstrerror(h_errno));
! break;
! default:
! msg_warn("gethostbyaddr(%s): %s", peer.addr, hstrerror(h_errno));
! break;
! }
! peer.name = "unknown";
! } else {
! peer.name = (valid_hostname(hp->h_name, DO_GRIPE) ?
! hp->h_name : "unknown");
! }
return (&peer);
#else
case AF_INET:
peer.type = PEER_TYPE_INET;
! peer.addr = inet_ntop(AF_INET6, &sin6addr, abuf, sizeof(abuf));
! if (!peer.addr)
! asprintf((char **) &peer.addr, "(%s)", strerror(errno)); /* XXX may leak/fail!!! */
! if ((eia = getnameinfo(&sa, len, hbuf, sizeof(hbuf), (char *) NULL, 0, NI_NAMEREQD)) != 0) {
peer.name = "unknown";
! switch (eia) {
! case EAI_NONAME:
! if (msg_verbose) {
! msg_info("%s: getnameinfo(AF_INET[%s], %d): %s\n",
! myname,
! peer.addr,
! sa.sa_len,
! streiaret(eia, errno));
! }
! break;
! default:
! msg_warn("%s: getnameinfo(AF_INET[%s], %d): %s\n",
! myname,
! peer.addr,
! sa.sa_len,
! streiaret(eia, errno));
! break;
! }
! } else
peer.name = hbuf;
return (&peer);
case AF_INET6:
peer.type = PEER_TYPE_INET6;
! peer.addr = inet_ntop(AF_INET6, &sin6addr, abuf, sizeof(abuf));
! if (!peer.addr)
! asprintf((char **) &peer.addr, "(%s)", strerror(errno)); /* XXX may leak/fail!!! */
! if ((eia = getnameinfo(&sa, len, hbuf, sizeof(hbuf), (char *) NULL, 0, NI_NAMEREQD)) != 0) {
peer.name = "unknown";
! switch (eia) {
! case EAI_NONAME:
! if (msg_verbose) {
! msg_info("%s: getnameinfo(AF_INET6[%s], %d): %s\n",
! myname,
! peer.addr,
! sa.sa_len,
! streiaret(eia, errno));
! }
! break;
! default:
! msg_warn("%s: getnameinfo(AF_INET6[%s], %d): %s\n",
! myname,
! peer.addr,
! sa.sa_len,
! streiaret(eia, errno));
! break;
! }
! } else
peer.name = hbuf;
return (&peer);
#endif
case AF_UNSPEC:
Index: src/postconf/postconf.c
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/postconf/postconf.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 postconf.c
*** src/postconf/postconf.c 2001/03/25 06:59:11 1.1.1.1
--- src/postconf/postconf.c 2001/05/07 20:24:41
***************
*** 77,82 ****
--- 77,83 ----
#include <vstream.h>
#include <msg_vstream.h>
#include <get_hostname.h>
+ #include <get_domainname.h>
#include <stringops.h>
#include <htable.h>
#include <dict.h>
***************
*** 189,194 ****
--- 190,197 ----
/* check_myhostname - lookup hostname and validate */
+ /* XXX this code is duplicated in ../global/mail_params.c!!! */
+
static const char *check_myhostname(void)
{
static const char *name;
***************
*** 208,215 ****
* XXX Do not complain when running as "postconf -d".
*/
name = get_hostname();
if ((mode & SHOW_DEFS) == 0 && (dot = strchr(name, '.')) == 0) {
! if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0) {
msg_warn("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf",
name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir);
} else {
--- 211,222 ----
* XXX Do not complain when running as "postconf -d".
*/
name = get_hostname();
+ domain = mail_conf_lookup_eval(VAR_MYDOMAIN);
+ if (!domain) {
+ domain = get_domainname();
+ }
if ((mode & SHOW_DEFS) == 0 && (dot = strchr(name, '.')) == 0) {
! if (domain == 0) {
msg_warn("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf",
name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir);
} else {
***************
*** 219,225 ****
return (name);
}
! /* get_myhostname - look up and store my hostname */
static void get_myhostname(void)
{
--- 226,232 ----
return (name);
}
! /* get_myhostname - look up and store my hostname XXX NOT USED!!! */
static void get_myhostname(void)
{
***************
*** 232,250 ****
/* check_mydomainname - lookup domain name and validate */
static const char *check_mydomainname(void)
{
! char *dot;
! /*
! * Use the hostname when it is not a FQDN ("foo"), or when the hostname
! * actually is a domain name ("foo.com").
! */
! if (var_myhostname == 0)
! get_myhostname();
! if ((dot = strchr(var_myhostname, '.')) == 0 || strchr(dot + 1, '.') == 0)
! return (var_myhostname);
! return (dot + 1);
}
/* check_mynetworks - lookup network address list */
--- 239,265 ----
/* check_mydomainname - lookup domain name and validate */
+ /* XXX this code is duplicated in ../global/mail_params.c!!! */
+
static const char *check_mydomainname(void)
{
! const char *name;
! if ((name = get_domainname()) == 0) {
! name = mail_conf_lookup_eval(VAR_MYDOMAIN);
! }
! return name;
! }
!
! /* get_mydomain - look up and store my domain XXX NOT USED!!! */
!
! static void get_mydomain(void)
! {
! const char *name;
!
! if ((name = dict_lookup(CONFIG_DICT, VAR_MYDOMAIN)) == 0)
! name = check_mydomainname();
! var_mydomain = mystrdup(name);
}
/* check_mynetworks - lookup network address list */
Index: src/smtpd/smtpd_peer.c
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/smtpd/smtpd_peer.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 smtpd_peer.c
*** src/smtpd/smtpd_peer.c 2001/03/25 06:59:14 1.1.1.1
--- src/smtpd/smtpd_peer.c 2001/05/08 20:52:45
***************
*** 115,120 ****
--- 115,122 ----
sa = (struct sockaddr *)&ss;
len = sizeof(ss);
+ /* XXX XXX !!! why the hell doesn't this call peer_name()!?!?!?!?!?!? */
+
/*
* Look up the peer address information.
*/
***************
*** 142,174 ****
)) {
#ifdef INET6
char hbuf[NI_MAXHOST];
struct addrinfo hints, *rnull = NULL;
#else
! char hbuf[sizeof("255.255.255.255") + 1];
#endif
int error = -1;
#ifdef INET6
! (void)getnameinfo(sa, len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST);
#else
in = &((struct sockaddr_in *)sa)->sin_addr;
! inet_ntop(AF_INET, in, hbuf, sizeof(hbuf));
#endif
! state->addr = mystrdup(hbuf);
#ifdef INET6
! error = getnameinfo(sa, len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD);
#else
hp = gethostbyaddr((char *)in, sizeof(*in), AF_INET);
! if (hp && strlen(hp->h_name) < sizeof(hbuf) - 1) {
error = 0;
! strncpy(hbuf, hp->h_name, sizeof(hbuf) - 1);
! hbuf[sizeof(hbuf) - 1] = '\0';
! } else
error = 1;
#endif
if (error) {
state->name = mystrdup("unknown");
state->peer_code = (h_errno == TRY_AGAIN ? 4 : 5);
} else if (!valid_hostname(hbuf, DONT_GRIPE)) {
state->name = mystrdup("unknown");
state->peer_code = 5;
--- 144,205 ----
)) {
#ifdef INET6
char hbuf[NI_MAXHOST];
+ char abuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")+1];
struct addrinfo hints, *rnull = NULL;
#else
! char *hbuf;
! char abuf[sizeof("255.255.255.255") + 1];
#endif
int error = -1;
+ /*
+ * First we make a printable form of the peer's address...
+ */
#ifdef INET6
! (void)getnameinfo(sa, len, abuf, sizeof(abuf), NULL, 0, NI_NUMERICHOST);
#else
in = &((struct sockaddr_in *)sa)->sin_addr;
! if (!inet_ntop(AF_INET, in, abuf, sizeof(abuf))) {
! snprintf((char *) abuf, sizeof(abuf), "(%s)", strerror(errno));
! error = 1;
! }
#endif
! state->addr = mystrdup(abuf);
!
! /*
! * Then we look up the peer's name from its address...
! */
#ifdef INET6
! if (msg_verbose)
! msg_warn("%s: calling getnameinfo(%s[%s], %d)...",
! "smtpd_peer_init",
! sa->sa_family == AF_INET ? "AF_INET" : "AF_INET6",
! state->addr,
! sizeof(*in));
! if ((error = getnameinfo(sa, len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) != 0)
! msg_warn("%s: hostname %s lookup failed: %s",
! state->addr, state->name, error == EIA_SYSTEM : strerror(errno) : gai_strerror(error));
#else
+ if (msg_verbose)
+ msg_warn("%s: calling gethostbyaddr([%s], %d, AF_INET)...",
+ "smtpd_peer_init", state->addr, sizeof(*in));
hp = gethostbyaddr((char *)in, sizeof(*in), AF_INET);
! if (hp) {
error = 0;
! hbuf = hp->h_name;
! } else {
! msg_warn("%s: hostname %s lookup failed: %s",
! state->addr, state->name, HSTRERROR(h_errno));
error = 1;
+ }
#endif
if (error) {
state->name = mystrdup("unknown");
+ #ifdef INET6
+ state->peer_code = (error == EAI_AGAIN ? 4 : 5);
+ #else
state->peer_code = (h_errno == TRY_AGAIN ? 4 : 5);
+ #endif
} else if (!valid_hostname(hbuf, DONT_GRIPE)) {
state->name = mystrdup("unknown");
state->peer_code = 5;
***************
*** 189,204 ****
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo(state->name, NULL, &hints, &rnull);
if (error) {
msg_warn("%s: hostname %s verification failed: %s",
! state->addr, state->name, gai_strerror(error));
REJECT_PEER_NAME(state, (error == EAI_AGAIN ? 4 : 5));
}
/* memcmp() isn't needed if we use getaddrinfo */
if (rnull)
freeaddrinfo(rnull);
#else
hp = gethostbyname(state->name); /* clobbers hp->name!! */
if (hp == 0) {
msg_warn("%s: hostname %s verification failed: %s",
--- 220,242 ----
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
+ if (msg_verbose)
+ msg_warn("%s: calling getaddrinfo(%s)...",
+ "smtpd_peer_init",
+ state->name);
error = getaddrinfo(state->name, NULL, &hints, &rnull);
if (error) {
msg_warn("%s: hostname %s verification failed: %s",
! state->addr, state->name, error == EIA_SYSTEM : strerror(errno) : gai_strerror(error));
REJECT_PEER_NAME(state, (error == EAI_AGAIN ? 4 : 5));
}
/* memcmp() isn't needed if we use getaddrinfo */
if (rnull)
freeaddrinfo(rnull);
#else
+ if (msg_verbose)
+ msg_warn("%s: calling gethostbyname(%s)...",
+ "smtpd_peer_init", state->name, sizeof(*in));
hp = gethostbyname(state->name); /* clobbers hp->name!! */
if (hp == 0) {
msg_warn("%s: hostname %s verification failed: %s",
Index: src/util/get_domainname.c
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/util/get_domainname.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 get_domainname.c
*** src/util/get_domainname.c 2001/03/25 06:59:18 1.1.1.1
--- src/util/get_domainname.c 2001/05/07 20:07:33
***************
*** 41,47 ****
/* Local stuff. */
! static char *my_domain_name;
/* get_domainname - look up my domain name */
--- 41,47 ----
/* Local stuff. */
! static char *my_domain_name; /* XXX this should not be saved.... */
/* get_domainname - look up my domain name */
***************
*** 50,65 ****
const char *host;
const char *dot;
- /*
- * Use the hostname when it is not a FQDN ("foo"), or when the hostname
- * actually is a domain name ("foo.com").
- */
if (my_domain_name == 0) {
! host = get_hostname();
! if ((dot = strchr(host, '.')) == 0 || strchr(dot + 1, '.') == 0) {
! my_domain_name = mystrdup(host);
} else {
! my_domain_name = mystrdup(dot + 1);
}
}
return (my_domain_name);
--- 50,79 ----
const char *host;
const char *dot;
if (my_domain_name == 0) {
! char domain[MAXHOSTNAMELEN];
!
! if (getdomainname(domain, sizeof(domain)) == -1) {
! msg_fatal("getdomainname(): %m");
! }
! if (*domain) {
! if (*domain == '.') {
! dot = domain + 1;
! } else {
! dot = domain;
! }
! my_domain_name = mystrdup(dot);
} else {
! /*
! * Use the hostname when it is not a FQDN ("foo"), or when the
! * hostname actually is a domain name ("foo.com").
! */
! host = get_hostname();
! if ((dot = strchr(host, '.')) == 0 || strchr(dot + 1, '.') == 0) {
! my_domain_name = mystrdup(host);
! } else {
! my_domain_name = mystrdup(dot + 1);
! }
}
}
return (my_domain_name);
Index: src/util/valid_hostname.c
===================================================================
RCS file: /cvs/NetBSD/src/gnu/dist/postfix/src/util/valid_hostname.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 valid_hostname.c
*** src/util/valid_hostname.c 2001/03/25 06:59:20 1.1.1.1
--- src/util/valid_hostname.c 2001/05/07 19:56:09
***************
*** 85,91 ****
* Find bad characters or label lengths. Find adjacent delimiters.
*/
for (cp = name; (ch = *(unsigned char *) cp) != 0; cp++) {
! if (ISALNUM(ch) || ch == '_') { /* grr.. */
if (label_length == 0)
label_count++;
label_length++;
--- 85,91 ----
* Find bad characters or label lengths. Find adjacent delimiters.
*/
for (cp = name; (ch = *(unsigned char *) cp) != 0; cp++) {
! if (ISALNUM(ch)) {
if (label_length == 0)
label_count++;
label_length++;
>Release-Note:
>Audit-Trail:
From: itojun@iijlab.net
To: woods@weird.com (Greg A. Woods)
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 08:09:52 +0900
>>Synopsis: NetBSD's INET6 patches to Postfix break non-INET6 features!
sorry for the mess. could you PLEASE identify which part of the
diff is the important piece here? there are a lot of non-related
cosmetic changes included, and it prevents me from fixing the issue.
itojun
From: woods@weird.com (Greg A. Woods)
To: itojun@iijlab.net
Cc: gnats-bugs@gnats.netbsd.org,
netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 20:36:40 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 08:09:52 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> sorry for the mess. could you PLEASE identify which part of the
> diff is the important piece here? there are a lot of non-related
> cosmetic changes included, and it prevents me from fixing the issue.
In my opinion it's all critical. :-)
The changes to peer_name() are probably cosmetic because nothing
critical ever calls it, but since the code's there it should probably be
correct (I think the only fix in peer_name() is to add error logging).
The changes to the anything related to domain and host names should
probably be checked in with a separate comment (assuming you agree to
check them in! ;-), but that's easy because they're all in separate
files.
The really crictical fixes are all in smtpd_peer_init.c (if I remember
the name correctly)...
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: itojun@iijlab.net
To: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and
followups),
netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 09:59:28 +0900
>The changes to the anything related to domain and host names should
>probably be checked in with a separate comment (assuming you agree to
>check them in! ;-), but that's easy because they're all in separate
>files.
i believe the use of getdomainname() is a bad idea. NIS domain name
has nothing to do with email delivery.
>The really crictical fixes are all in smtpd_peer_init.c (if I remember
>the name correctly)...
thanks for your clarifications.
itojun
From: itojun@iijlab.net
To: woods@weird.com (Greg A. Woods)
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 11:13:15 +0900
>>Synopsis: NetBSD's INET6 patches to Postfix break non-INET6 features!
try gnu/dist/postfix/src/smtpd/smtpd_peer.c revision 1.3.
i still don't understand this "more than 17 letters" part.
your changes to hostname buffer length are totally cosmetic.
> try enabling "smtpd_client_restrictions = reject_unknown_client"
>
> also set "smtpd_reject_delay = no" for best effect
>
> connect to the test postfix from a machine with a ``long''
> hostname.... (more than 17 characters will do fine)
itojun
From: woods@weird.com (Greg A. Woods)
To: itojun@iijlab.net
Cc: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and followups),
netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 22:32:57 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 09:59:28 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> i believe the use of getdomainname() is a bad idea. NIS domain name
> has nothing to do with email delivery.
The "domainname" stored in the kernel has no direct relationship to
anything but itself. On machines that do not ever come near NIS (one
service which can use this stored string) (probably no machine on the
public Internet should ever do so too), it's perfectly reasonable to
store the default DNS domain name in the kernel using this facility (and
I do and ahve done for many many years now!).
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: itojun@iijlab.net
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 11:53:40 +0900
>[ On Wednesday, May 9, 2001 at 09:59:28 (+0900), itojun@iijlab.net wrote: ]
>> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>>
>> i believe the use of getdomainname() is a bad idea. NIS domain name
>> has nothing to do with email delivery.
>
>The "domainname" stored in the kernel has no direct relationship to
>anything but itself. On machines that do not ever come near NIS (one
>service which can use this stored string) (probably no machine on the
>public Internet should ever do so too), it's perfectly reasonable to
>store the default DNS domain name in the kernel using this facility (and
>I do and ahve done for many many years now!).
then, you at least need to check if the machine is running NIS or not,
and suppress getdomainname() case if NIS is running. IMHO.
itojun
From: woods@weird.com (Greg A. Woods)
To: itojun@iijlab.net
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 23:12:37 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 11:53:40 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> then, you at least need to check if the machine is running NIS or not,
> and suppress getdomainname() case if NIS is running. IMHO.
No, not really. Half the time the NIS domain is the same as the DNS
domain, and the rest of the time you have to set $mydomain anyway so
it's never a loss (the $mydomain setting overrides in all cases).
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: itojun@iijlab.net
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 12:34:31 +0900
>[ On Wednesday, May 9, 2001 at 11:53:40 (+0900), itojun@iijlab.net wrote: ]
>> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>> then, you at least need to check if the machine is running NIS or not,
>> and suppress getdomainname() case if NIS is running. IMHO.
>No, not really. Half the time the NIS domain is the same as the DNS
>domain, and the rest of the time you have to set $mydomain anyway so
>it's never a loss (the $mydomain setting overrides in all cases).
I disagree. in most of the NIS installations (from my university
days) they used NIS domain name totally different from DNS domain name,
I saw documents that recommended strongly against the use of the
same string, because of "security from obscurity" reasons.
anyway, i do not feel like merging the part of the patch.
itojun
From: Jason R Thorpe <thorpej@zembu.com>
To: itojun@iijlab.net
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 20:37:28 -0700
On Wed, May 09, 2001 at 12:34:31PM +0900, itojun@iijlab.net wrote:
> I disagree. in most of the NIS installations (from my university
> days) they used NIS domain name totally different from DNS domain name,
> I saw documents that recommended strongly against the use of the
> same string, because of "security from obscurity" reasons.
> anyway, i do not feel like merging the part of the patch.
Indeed -- I have almost never tied NIS domain to DNS domain. In many
environments I've worked in, a single DNS domain or sub-domain might
have had 3 or 4 NIS domains.
--
-- Jason R. Thorpe <thorpej@zembu.com>
State-Changed-From-To: open->feedback
State-Changed-By: itojun
State-Changed-When: Tue May 8 20:38:33 PDT 2001
State-Changed-Why:
try new smtpd_peer.c and report if it remedies your problem.
From: Andrew Brown <atatat@atatdot.net>
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Cc: itojun@iijlab.net
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 23:42:28 -0400
>> then, you at least need to check if the machine is running NIS or not,
>> and suppress getdomainname() case if NIS is running. IMHO.
>
>No, not really. Half the time the NIS domain is the same as the DNS
>domain, and the rest of the time you have to set $mydomain anyway so
>it's never a loss (the $mydomain setting overrides in all cases).
the nis domain name is stored, for nis purposes, by setdomainname().
a host's domain name, for dns purposes, is usually stored in
/etc/resolv.conf.
a host's domain for mail purposes is usually the dns domain name,
unless overriden in whatever configuration files your mua/mta reads.
a host's kerberos realm is stored in yet another file.
most things fall back to dns (for mx records, or srv records, etc)
unless told otherwise. no one falls back on nis.
fwiw - i have no idea why nis gets kernel help for its dirty work.
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."
From: woods@weird.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 23:41:14 -0400 (EDT)
[ On Tuesday, May 8, 2001 at 20:37:28 (-0700), Jason R Thorpe wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> Indeed -- I have almost never tied NIS domain to DNS domain. In many
> environments I've worked in, a single DNS domain or sub-domain might
> have had 3 or 4 NIS domains.
Some do, some don't. I've personally never seen an environment where it
wasn't the same, or at least related, but hen I've only seen a few NIS
domains.
Note too that in private environments I've seen where NIS is used the
internal mail routing uses the NIS domain anyway, and since Postfix uses
just gethostbyname()/gethostbyaddr() (or getnameinfo()/getaddrinfo())
it'll use NIS for hostnames too.
In other words my fix to default $mydomain to domainname(2) is in fact
correct for *all* environments I've ever seen personally, with or
without NIS!
In any case it simply cannot lose. Either it will make the default
right and thus make Postfix work transparently without any local
configuration changes, or it will leave it as wrong (not empty, but
still wrong) and the admin will still be required to manually set
$myname and $mydomain.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: itojun@iijlab.net
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 13:00:09 +0900
submit your patch to wietse and see what happens. from the discussions
here i don't think it wise to bring in your patch locally.
itojun
From: woods@weird.com (Greg A. Woods)
To: Andrew Brown <atatat@atatdot.net>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org,
itojun@iijlab.net
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 23:45:58 -0400 (EDT)
[ On Tuesday, May 8, 2001 at 23:42:28 (-0400), Andrew Brown wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> >> then, you at least need to check if the machine is running NIS or not,
> >> and suppress getdomainname() case if NIS is running. IMHO.
> >
> >No, not really. Half the time the NIS domain is the same as the DNS
> >domain, and the rest of the time you have to set $mydomain anyway so
> >it's never a loss (the $mydomain setting overrides in all cases).
>
> the nis domain name is stored, for nis purposes, by setdomainname().
RTFM man. Setdomainname() has nothing specific to do with NIS or DNS or
anything else. It's simply a convenient way to store a string in the
kernel. Same as "hostname" which can be either for NIS, DNS, UUCP, or
whatever. There's no inherent meaning attached to these other than
their given "names".
> fwiw - i have no idea why nis gets kernel help for its dirty work.
It doesn't, and that's the point. Those kernel storage places are for
generic use -- use them for whatever purpose you need them for.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: itojun@iijlab.net
To: woods@weird.com (Greg A. Woods)
Cc: Andrew Brown <atatat@atatdot.net>, gnats-bugs@gnats.netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 09 May 2001 13:05:21 +0900
>RTFM man. Setdomainname() has nothing specific to do with NIS or DNS or
>anything else. It's simply a convenient way to store a string in the
>kernel. Same as "hostname" which can be either for NIS, DNS, UUCP, or
>whatever. There's no inherent meaning attached to these other than
>their given "names".
go look at domainname(1) and bin/domainname/domainname.c.
itojun
From: Andrew Brown <atatat@atatdot.net>
To: "Greg A. Woods" <woods@weird.com>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org, itojun@iijlab.net
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 9 May 2001 00:10:58 -0400
>> >> then, you at least need to check if the machine is running NIS or not,
>> >> and suppress getdomainname() case if NIS is running. IMHO.
>> >
>> >No, not really. Half the time the NIS domain is the same as the DNS
>> >domain, and the rest of the time you have to set $mydomain anyway so
>> >it's never a loss (the $mydomain setting overrides in all cases).
>>
>> the nis domain name is stored, for nis purposes, by setdomainname().
>
>RTFM man. Setdomainname() has nothing specific to do with NIS or DNS or
>anything else. It's simply a convenient way to store a string in the
>kernel. Same as "hostname" which can be either for NIS, DNS, UUCP, or
>whatever. There's no inherent meaning attached to these other than
>their given "names".
i did. and the source. netbsd says it's for storing the domainname,
with no particular indication of why or wherefore. other systems (eg
solaris) use it for nis. i'm very much in favor of homogeneity, so
i'm not about to go storing something in somewhere which some systems
use for nix and some don't. i'll find a way that works the same way
on all machines. netbsd's nis was written "to be compatible with
Sun's implementation". i'd be surprised if it didn't use the kernel
info (modulo it simply being told not to).
>> fwiw - i have no idea why nis gets kernel help for its dirty work.
>
>It doesn't, and that's the point. Those kernel storage places are for
>generic use -- use them for whatever purpose you need them for.
under netbsd it doesn't have a special purpose. saying it's for mail
is just as wrong as anything else.
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."
From: woods@weird.com (Greg A. Woods)
To: itojun@iijlab.net
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@NetBSD.ORG
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Tue, 8 May 2001 23:55:14 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 12:34:31 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> I disagree. in most of the NIS installations (from my university
> days) they used NIS domain name totally different from DNS domain name,
so?
> I saw documents that recommended strongly against the use of the
> same string, because of "security from obscurity" reasons.
Hmmm... that argument would have to be the other way around to make sense....
Anyway, like I said, any machine running NIS should probably be kept as
far away from any public network as possible....
> anyway, i do not feel like merging the part of the patch.
I really can't imagine what you're afraid of -- such a feature can only
be a benefit to those who make use of it. Those who don't make use of
it won't even know it's there since they'll have to override whatever it
might do in any case.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: jchacon@genuity.net
To: atatat@atatdot.net
Cc: woods@weird.com (Greg A. Woods), gnats-bugs@gnats.netbsd.org,
netbsd-bugs@netbsd.org, itojun@iijlab.net
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 9 May 2001 01:13:05 -0400 (EDT)
>>> fwiw - i have no idea why nis gets kernel help for its dirty work.
>>
>>It doesn't, and that's the point. Those kernel storage places are for
>>generic use -- use them for whatever purpose you need them for.
>
>under netbsd it doesn't have a special purpose. saying it's for mail
>is just as wrong as anything else.
>
I agree.
Any sane NIS admin has it beat into them early on that NIS != DNS. Depending
on one or the other to cross-pollute name spaces is rather silly since now
you're special purposing something that was just claimed to be generic.
James
From: woods@weird.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 9 May 2001 01:11:54 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 13:05:21 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> go look at domainname(1) and bin/domainname/domainname.c.
Those comments are based on are false assumptions. The correct
definition is in sethostname(3) and setdomainname(3). There's nothing
whatsoever inside the kernel that uses either the hostname or the
domainname values for anything -- they are merely secure ways of storing
a pair of strings somewhere other than in the filesystem.
Any host can use them for DNS, NIS, UUCP, SMTP, Kerberos, whatever.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: woods@weird.com (Greg A. Woods)
To: Andrew Brown <atatat@atatdot.net>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 9 May 2001 01:21:05 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 00:10:58 (-0400), Andrew Brown wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> i did. and the source. netbsd says it's for storing the domainname,
> with no particular indication of why or wherefore. other systems (eg
> solaris) use it for nis.
You're mixing up concepts here. The SunOS kernel doesn't use these
values -- it merely holds them. They can be used for anything. The NIS
applications use them one way. Other applications that might be
suitable for use when NIS isn't running can use them in any other way
they see fit. In a sane configuration many un-related applications can
all use the same value too! Not all the world runs NIS -- in fact
thankfully very little of the world runs NIS! I've *always* stored the
default DNS domain name with setdomainname(3) when possible on all
systems I've managed, even when NIS was also in use, and I didn't invent
the idea either! I've done so on many variants of SunOS, HP-UX, AIX,
SysVr4, DC/OSx, DYNIX/ptx, SCO, Amiga-UNIX, FreeBSD, NetBSD, BSD/OS,
etc., all with no problems, confusion, or other silly excuses.
> i'm very much in favor of homogeneity, so
> i'm not about to go storing something in somewhere which some systems
> use for nix and some don't.
What the heck does that nonsense mean!?!?!? It's not called setnisdomain!
> i'll find a way that works the same way
> on all machines. netbsd's nis was written "to be compatible with
> Sun's implementation". i'd be surprised if it didn't use the kernel
> info (modulo it simply being told not to).
You're lost between levels here and stuck in some mode that may not
apply to half the rest of the world or more!
> under netbsd it doesn't have a special purpose.
EXACTLY!
> saying it's for mail
> is just as wrong as anything else.
Wrong? No, "just as right!"
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: woods@weird.com (Greg A. Woods)
To: jchacon@genuity.net
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 9 May 2001 01:24:19 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 01:13:05 (-0400), jchacon@genuity.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> Any sane NIS admin has it beat into them early on that NIS != DNS.
and you believed all that silly propoganda fed to you by the Sun SALES
engineer? :-)
> Depending
> on one or the other to cross-pollute name spaces is rather silly since now
> you're special purposing something that was just claimed to be generic.
On the contrary I can prove from past experience that coalescing these
namespaces is extremely helpful and makes for far less confusion. One
name for everything no matter which way you look at it from is in fact
the more generic approach....
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: woods@weird.com (Greg A. Woods)
To: itojun@iijlab.net
Cc: gnats-bugs@gnats.netbsd.org,
netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Wed, 9 May 2001 11:35:45 -0400 (EDT)
[ On Wednesday, May 9, 2001 at 11:13:15 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
>
> try gnu/dist/postfix/src/smtpd/smtpd_peer.c revision 1.3.
I don't have to try it to know that it absolutely cannot work. You did
not apply my changes. You could not have done the tests I suggested, at
least not without -DINET6 or you too would know that your commit doesn't
fix the bug.
Please apply *all* of my changes, exactly as I made them if you don't
understand them, and then *test* them! They were primarily designed to
fix a bug in the #ifndef INET6 code. If you don't have a suitable
environment in which to test that way then you must apply all of my
changes verbatim, at least to the code sections which you cannot test,
and then trust that I have done the testing just as I explicitly claimed
I did. Do not ask me to test your idea of my changes without having
tested them yourself to see if they indeed fix the problem I described
in the same way that my changes fix the problem. I'll try to compile
the whole thing with -DINET6 and try testing it myself today, though I
don't currently have any IPv6 networks configured on my machines, though
they do have it in their kernels. (of course it's just as important to
test the INET6 code with IPv4 configurations too....)
> i still don't understand this "more than 17 letters" part.
> your changes to hostname buffer length are totally cosmetic.
An array of sizeof("255.255.255.255"), even +1, is not anywhere near
long enough to hold your average fully qualified hostname..... I
thought the comments I put in there to show what's being done at which
stage would make this clear.
BTW, I'm guessing that Wietse won't accept any INET6 patches that are
just #ifdefs. I think the best way to fully fix this maze of
conditional compilation would be to first fix the code to call the
already present peer_name() from libglobal and then to provide an
alternate peer_name6.c that's been changed to use getnameinfo() and
getaddrinfo() exclusively.
Unfortunately getnameinfo() is a totally useless API for use in
scenarios where what's really wanted are the actual DNS records returned
(at least for the case where DNS is being used), and that's exactly what
is really needed in Postfix (though other fixes need to be done in that
manner too). It's really too bad it wasn't designed to return a linked
list of struct nameinfo records in a manner similar to what
getaddrinfo() does. This will have to be corrected in some way at some
time soon.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: itojun@iijlab.net
To: gnats-bugs@gnats.netbsd.org,
netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Cc:
Subject: Re: bin/12876: NetBSD's INET6 patches to Postfix break non-INET6 features!
Date: Thu, 10 May 2001 05:29:16 +0900
>> try gnu/dist/postfix/src/smtpd/smtpd_peer.c revision 1.3.
>I don't have to try it to know that it absolutely cannot work. You did
>not apply my changes. You could not have done the tests I suggested, at
>least not without -DINET6 or you too would know that your commit doesn't
>fix the bug.
>Please apply *all* of my changes, exactly as I made them if you don't
no. i don't take patches that does not relate to the PR itself.
>understand them, and then *test* them! They were primarily designed to
fair enough, i'll try to test. next time do not ever think of
including tons of costmetic changes which is not maintainable.
>> i still don't understand this "more than 17 letters" part.
>> your changes to hostname buffer length are totally cosmetic.
>An array of sizeof("255.255.255.255"), even +1, is not anywhere near
>long enough to hold your average fully qualified hostname..... I
>thought the comments I put in there to show what's being done at which
>stage would make this clear.
ok.
>BTW, I'm guessing that Wietse won't accept any INET6 patches that are
>just #ifdefs.
SO WHAT? thanks for your unrelated comment. it's up to wietse,
not you.
>I think the best way to fully fix this maze of
>conditional compilation would be to first fix the code to call the
>already present peer_name() from libglobal and then to provide an
>alternate peer_name6.c that's been changed to use getnameinfo() and
>getaddrinfo() exclusively.
bzzzt. i confirmed with wietse and he said that peer_name is
deprecated and the new code should use smtpd/smtpd_peer.c.
you wrong.
itojun
State-Changed-From-To: feedback->closed
State-Changed-By: itojun
State-Changed-When: Mon May 14 10:37:05 PDT 2001
State-Changed-Why:
i believe it is already fixed
From: itojun@iijlab.net
To: woods@weird.com (Greg A. Woods)
Cc: gnats-admin@netbsd.org
Subject: Re: bin/12876
Date: Tue, 15 May 2001 05:09:41 +0900
>I don't. Your changes are still missing critical things and doing other
>stuff that's, if not incorrect, at least is unnecessary.
please be more specific.
- what is "critical things"? the latest netbsd tree should solve
all the issues mentioned in the desription of the PR, so i consider
it closed. for diffs that does not relate to the description, i
consider them cosmetic and unnecessary (most of them are logging
changes, which should go through wietse i guess).
- which part of my change (that marked with "PR12876") seem unnecessary?
itojun
From: itojun@iijlab.net
To: woods@weird.com (Greg A. Woods)
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/12876
Date: Tue, 15 May 2001 05:10:32 +0900
why cc: to gnats-admin? it is not appropriate.
itojun
From: woods@weird.com (Greg A. Woods)
To: itojun@iijlab.net
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/12876
Date: Mon, 14 May 2001 16:49:56 -0400 (EDT)
[ On Tuesday, May 15, 2001 at 05:10:32 (+0900), itojun@iijlab.net wrote: ]
> Subject: Re: bin/12876
>
>
> why cc: to gnats-admin? it is not appropriate.
That's what reply-all did -- I presume it's because the NetBSD gnats
server is configured to CC gnats-admin on all edit-pr actions. I don't
know if that's appropriate, or not... it's not my GNATs server. :-)
(I'd rather the GNATs server be re-configured to always CC netbsd-bugs)
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
To: woods@weird.com (Greg A. Woods)
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/12876
Date: Tue, 15 May 2001 06:40:24 +0900
again you have cc'ed to gnats-admin.
>Did you actually test using my test-case? Could you reproduce the
>problem I described in the version without any changes, and then see
>that it is fixed with them?
YES, i have tested it with both !INET6 and INET6
(i left one item and fixed it just now).
mystrdup() is indeed necessary.
>I do know that my version of the changes work correctly (without
>-DINET6) and not only fix the problem but make any future occurances of
>it possible to diagnose without editing the code again.
that does not amend it to merge the whole bunch of cosmetic
diffs altogether.
>I find your reluctance to include the additional debugging output very
>disconcerting too. You can't even know exactly what the problem is
>without it (at least not unless you run the smtpd under a debugger,
>which isn't exactly trivial to arrange for in Postfix...). I've never
>yet seen any one actually complain about getting an accurate error
>message from a program, especially when it's failing mysteriously.
we don't need to commit these test code into our tree! they are
just for debugging period.
>In the INET6 code I also see that you've not corrected what little
>printing of error messages is there -- don't you think that it is
>important to discern which system error might have been encountered by
>get*info() in the case where it might return EAI_SYSTEM?
fair enough. you should have describe it or send it as seprate PR.
itojun
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.