mailing list of musl libc
 help / color / mirror / code / Atom feed
* dn_expand() confuses postfix
@ 2013-08-13 18:19 orc
  2013-08-13 18:38 ` Rich Felker
  2013-08-14 22:06 ` Rich Felker
  0 siblings, 2 replies; 9+ messages in thread
From: orc @ 2013-08-13 18:19 UTC (permalink / raw)
  To: musl list

musl's dn_expand() confuses postfix - always returns 0, then postfix's
libdns.a gets wrong shifts and gives up with something like:

./test_dns_lookup: lookup yandex.ru type MX flags 2
./test_dns_lookup: dns_query: yandex.ru (MX): OK
./test_dns_lookup: warning: dns_get_fixed: bad class: 30722
./test_dns_lookup: fatal: Name service error for name=yandex.ru type=MX: Malformed or unexpected name server reply

If someone will face same error with postfix & musl, then get portable
dn_expand.c from
http://tclsysdns.googlecode.com/svn/trunk/unix/dn_expand.c and put it
in src/dns (edit Makefile.in to include src & obj).

(btw running whole LAMP/FTP stack with musl - some issues appear like
iconv need to be replaced with libiconv to make some CMS happy, so I
have some compatibility experience here. Musl much more perfect than I
expected)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-13 18:19 dn_expand() confuses postfix orc
@ 2013-08-13 18:38 ` Rich Felker
  2013-08-13 19:09   ` orc
  2013-08-14 22:06 ` Rich Felker
  1 sibling, 1 reply; 9+ messages in thread
From: Rich Felker @ 2013-08-13 18:38 UTC (permalink / raw)
  To: musl

On Wed, Aug 14, 2013 at 02:19:20AM +0800, orc wrote:
> musl's dn_expand() confuses postfix - always returns 0, then postfix's
> libdns.a gets wrong shifts and gives up with something like:
> 
> ../test_dns_lookup: lookup yandex.ru type MX flags 2
> ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> ../test_dns_lookup: warning: dns_get_fixed: bad class: 30722
> ../test_dns_lookup: fatal: Name service error for name=yandex.ru type=MX: Malformed or unexpected name server reply
> 
> If someone will face same error with postfix & musl, then get portable
> dn_expand.c from
> http://tclsysdns.googlecode.com/svn/trunk/unix/dn_expand.c and put it
> in src/dns (edit Makefile.in to include src & obj).

Cleaning up this code is part of the roadmap for 0.9.13, but I wasn't
aware that it was returning the wrong value. Thanks for bringing that
to my attention.

> (btw running whole LAMP/FTP stack with musl - some issues appear like
> iconv need to be replaced with libiconv to make some CMS happy, so I
> have some compatibility experience here.

Do you know what problems they hit with iconv? It's my intention that
iconv not need to be replaced. My guess is that the issue is failure
to automatically detect UTF-16 endianness via BOM, or missing charset
aliases for some charset strings.

> Musl much more perfect than I
> expected)

Great to hear. :-)

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-13 18:38 ` Rich Felker
@ 2013-08-13 19:09   ` orc
  2013-08-13 20:36     ` Rich Felker
  0 siblings, 1 reply; 9+ messages in thread
From: orc @ 2013-08-13 19:09 UTC (permalink / raw)
  To: musl

On Tue, 13 Aug 2013 14:38:17 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Wed, Aug 14, 2013 at 02:19:20AM +0800, orc wrote:
> > musl's dn_expand() confuses postfix - always returns 0, then
> > postfix's libdns.a gets wrong shifts and gives up with something
> > like:
> > 
> > ../test_dns_lookup: lookup yandex.ru type MX flags 2
> > ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> > ../test_dns_lookup: warning: dns_get_fixed: bad class: 30722
> > ../test_dns_lookup: fatal: Name service error for name=yandex.ru
> > type=MX: Malformed or unexpected name server reply
> > 
> > If someone will face same error with postfix & musl, then get
> > portable dn_expand.c from
> > http://tclsysdns.googlecode.com/svn/trunk/unix/dn_expand.c and put
> > it in src/dns (edit Makefile.in to include src & obj).
> 
> Cleaning up this code is part of the roadmap for 0.9.13, but I wasn't
> aware that it was returning the wrong value. Thanks for bringing that
> to my attention.
> 
> > (btw running whole LAMP/FTP stack with musl - some issues appear
> > like iconv need to be replaced with libiconv to make some CMS
> > happy, so I have some compatibility experience here.
> 
> Do you know what problems they hit with iconv? It's my intention that
> iconv not need to be replaced. My guess is that the issue is failure
> to automatically detect UTF-16 endianness via BOM, or missing charset
> aliases for some charset strings.

I don't know why some hacked-up CMS did not liked current iconv. But in
phpinfo, iconv version shown as "unknown" which is probably traced to
absense of /include/gnu/libc-version.h and I suspect that they check it
or use some nonstandard extensions or PHP is mad. Building PHP 5.4
statically with gnu libiconv.a reset version to known one and
everything works.
I need to ask our php hackers about this (they maintain stuff) or
grep for all iconv which appears in sources.

> 
> > Musl much more perfect than I
> > expected)
> 
> Great to hear. :-)

I replaced gnu libc stack with musl one on our middly loaded sites in
large LAN/MAN and it works great and easier to maintain, fix and modify
in a way you want :)

> 
> Rich



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-13 19:09   ` orc
@ 2013-08-13 20:36     ` Rich Felker
  0 siblings, 0 replies; 9+ messages in thread
From: Rich Felker @ 2013-08-13 20:36 UTC (permalink / raw)
  To: musl

On Wed, Aug 14, 2013 at 03:09:16AM +0800, orc wrote:
> > > (btw running whole LAMP/FTP stack with musl - some issues appear
> > > like iconv need to be replaced with libiconv to make some CMS
> > > happy, so I have some compatibility experience here.
> > 
> > Do you know what problems they hit with iconv? It's my intention that
> > iconv not need to be replaced. My guess is that the issue is failure
> > to automatically detect UTF-16 endianness via BOM, or missing charset
> > aliases for some charset strings.
> 
> I don't know why some hacked-up CMS did not liked current iconv. But in
> phpinfo, iconv version shown as "unknown" which is probably traced to
> absense of /include/gnu/libc-version.h and I suspect that they check it
> or use some nonstandard extensions or PHP is mad. Building PHP 5.4
> statically with gnu libiconv.a reset version to known one and
> everything works.
> I need to ask our php hackers about this (they maintain stuff) or
> grep for all iconv which appears in sources.

Hmm, so it sounds like there's a good chance this is just a case of
hard-coding known iconv implementations, and either PHP itself is
refusing to use an "unknown" implementation, or it's reporting the
implementation as "unknown" to PHP web apps, which in turn are
refusing to use it because it's unknown. Does my assessment here seem
correct? If so, I don't think it's an issue musl can address, but
rather something we should work with upstream PHP or CMS maintainers
to get fixed.

> > > Musl much more perfect than I
> > > expected)
> > 
> > Great to hear. :-)
> 
> I replaced gnu libc stack with musl one on our middly loaded sites in
> large LAN/MAN and it works great and easier to maintain, fix and modify
> in a way you want :)

Nice. If you find anywhere musl seems to be giving you problems or
performance bottlenecks, let us know. This is definitely a family of
usage cases I'd like to make friendly. VE images especially are a
place where I feel like musl is appealing since it's so fast and
simple to build the system from scratch.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-13 18:19 dn_expand() confuses postfix orc
  2013-08-13 18:38 ` Rich Felker
@ 2013-08-14 22:06 ` Rich Felker
  2013-08-15  6:14   ` orc
  1 sibling, 1 reply; 9+ messages in thread
From: Rich Felker @ 2013-08-14 22:06 UTC (permalink / raw)
  To: musl

On Wed, Aug 14, 2013 at 02:19:20AM +0800, orc wrote:
> musl's dn_expand() confuses postfix - always returns 0, then postfix's
> libdns.a gets wrong shifts and gives up with something like:
> 
> ../test_dns_lookup: lookup yandex.ru type MX flags 2
> ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> ../test_dns_lookup: warning: dns_get_fixed: bad class: 30722
> ../test_dns_lookup: fatal: Name service error for name=yandex.ru type=MX: Malformed or unexpected name server reply
> 
> If someone will face same error with postfix & musl, then get portable
> dn_expand.c from
> http://tclsysdns.googlecode.com/svn/trunk/unix/dn_expand.c and put it
> in src/dns (edit Makefile.in to include src & obj).

I've committed some fixes to this code. Please let me know if the
issue persists; I did not have test cases to check that the return
value is right, so there's a possibility it may be off-by-one or
something.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-14 22:06 ` Rich Felker
@ 2013-08-15  6:14   ` orc
  2013-08-15  6:36     ` Rich Felker
  2013-08-25  6:43     ` Rich Felker
  0 siblings, 2 replies; 9+ messages in thread
From: orc @ 2013-08-15  6:14 UTC (permalink / raw)
  To: musl

On Wed, 14 Aug 2013 18:06:25 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Wed, Aug 14, 2013 at 02:19:20AM +0800, orc wrote:
> > musl's dn_expand() confuses postfix - always returns 0, then
> > postfix's libdns.a gets wrong shifts and gives up with something
> > like:
> > 
> > ../test_dns_lookup: lookup yandex.ru type MX flags 2
> > ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> > ../test_dns_lookup: warning: dns_get_fixed: bad class: 30722
> > ../test_dns_lookup: fatal: Name service error for name=yandex.ru
> > type=MX: Malformed or unexpected name server reply
> > 
> > If someone will face same error with postfix & musl, then get
> > portable dn_expand.c from
> > http://tclsysdns.googlecode.com/svn/trunk/unix/dn_expand.c and put
> > it in src/dns (edit Makefile.in to include src & obj).
> 
> I've committed some fixes to this code. Please let me know if the
> issue persists; I did not have test cases to check that the return
> value is right, so there's a possibility it may be off-by-one or
> something.

Other issue now:

./test_dns_lookup: lookup yandex.ru type MX flags 2
./test_dns_lookup: dns_query: yandex.ru (MX): OK
./test_dns_lookup: warning: valid_hostname: invalid character 6(decimal): ?yande.?r
./test_dns_lookup: warning: malformed domain name in resource name of MX record for ?yande.?r: ?yande.?r
./test_dns_lookup: fatal: Name service error for name=yandex.ru type=MX: Malformed or unexpected name server reply

./test_dns_lookup: lookup ya.ru type MX flags 2
./test_dns_lookup: dns_query: ya.ru (MX): OK
./test_dns_lookup: warning: valid_hostname: invalid character 2(decimal): ?y.?r
./test_dns_lookup: warning: malformed domain name in resource name of MX record for ?y.?r: ?y.?r
./test_dns_lookup: fatal: Name service error for name=ya.ru type=MX: Malformed or unexpected name server reply

temp buffer at src/dns/dns_lookup.c:287 is messed up with these.

> 
> Rich



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-15  6:14   ` orc
@ 2013-08-15  6:36     ` Rich Felker
  2013-08-25  6:43     ` Rich Felker
  1 sibling, 0 replies; 9+ messages in thread
From: Rich Felker @ 2013-08-15  6:36 UTC (permalink / raw)
  To: musl

On Thu, Aug 15, 2013 at 02:14:22PM +0800, orc wrote:
> On Wed, 14 Aug 2013 18:06:25 -0400
> Rich Felker <dalias@aerifal.cx> wrote:
> 
> > On Wed, Aug 14, 2013 at 02:19:20AM +0800, orc wrote:
> > > musl's dn_expand() confuses postfix - always returns 0, then
> > > postfix's libdns.a gets wrong shifts and gives up with something
> > > like:
> > > 
> > > ../test_dns_lookup: lookup yandex.ru type MX flags 2
> > > ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> > > ../test_dns_lookup: warning: dns_get_fixed: bad class: 30722
> > > ../test_dns_lookup: fatal: Name service error for name=yandex.ru
> > > type=MX: Malformed or unexpected name server reply
> > > 
> > > If someone will face same error with postfix & musl, then get
> > > portable dn_expand.c from
> > > http://tclsysdns.googlecode.com/svn/trunk/unix/dn_expand.c and put
> > > it in src/dns (edit Makefile.in to include src & obj).
> > 
> > I've committed some fixes to this code. Please let me know if the
> > issue persists; I did not have test cases to check that the return
> > value is right, so there's a possibility it may be off-by-one or
> > something.
> 
> Other issue now:
> 
> ../test_dns_lookup: lookup yandex.ru type MX flags 2
> ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> ../test_dns_lookup: warning: valid_hostname: invalid character 6(decimal): ?yande.?r
> ../test_dns_lookup: warning: malformed domain name in resource name of MX record for ?yande.?r: ?yande.?r
> ../test_dns_lookup: fatal: Name service error for name=yandex.ru type=MX: Malformed or unexpected name server reply
> 
> ../test_dns_lookup: lookup ya.ru type MX flags 2
> ../test_dns_lookup: dns_query: ya.ru (MX): OK
> ../test_dns_lookup: warning: valid_hostname: invalid character 2(decimal): ?y.?r
> ../test_dns_lookup: warning: malformed domain name in resource name of MX record for ?y.?r: ?y.?r
> ../test_dns_lookup: fatal: Name service error for name=ya.ru type=MX: Malformed or unexpected name server reply
> 
> temp buffer at src/dns/dns_lookup.c:287 is messed up with these.

OK, I'll see if I can dump a dns packet or two to run the code on and
see if the return values look wrong..

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-15  6:14   ` orc
  2013-08-15  6:36     ` Rich Felker
@ 2013-08-25  6:43     ` Rich Felker
  2013-08-25  8:42       ` orc
  1 sibling, 1 reply; 9+ messages in thread
From: Rich Felker @ 2013-08-25  6:43 UTC (permalink / raw)
  To: musl

On Thu, Aug 15, 2013 at 02:14:22PM +0800, orc wrote:
> Other issue now:
> 
> ../test_dns_lookup: lookup yandex.ru type MX flags 2
> ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> ../test_dns_lookup: warning: valid_hostname: invalid character 6(decimal): ?yande.?r
> ../test_dns_lookup: warning: malformed domain name in resource name of MX record for ?yande.?r: ?yande.?r
> ../test_dns_lookup: fatal: Name service error for name=yandex.ru type=MX: Malformed or unexpected name server reply
> 
> ../test_dns_lookup: lookup ya.ru type MX flags 2
> ../test_dns_lookup: dns_query: ya.ru (MX): OK
> ../test_dns_lookup: warning: valid_hostname: invalid character 2(decimal): ?y.?r
> ../test_dns_lookup: warning: malformed domain name in resource name of MX record for ?y.?r: ?y.?r
> ../test_dns_lookup: fatal: Name service error for name=ya.ru type=MX: Malformed or unexpected name server reply
> 
> temp buffer at src/dns/dns_lookup.c:287 is messed up with these.

I believe this was actually a nasty regression in the dn_expand "fix"
-- somehow I thought my tests were checking reverse dns, but they
weren't, and the new code actually had a bad off-by-one error. It
should be fixed now. Let me know if you're still experiencing
problems.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: dn_expand() confuses postfix
  2013-08-25  6:43     ` Rich Felker
@ 2013-08-25  8:42       ` orc
  0 siblings, 0 replies; 9+ messages in thread
From: orc @ 2013-08-25  8:42 UTC (permalink / raw)
  To: musl

On Sun, 25 Aug 2013 02:43:21 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> On Thu, Aug 15, 2013 at 02:14:22PM +0800, orc wrote:
> > Other issue now:
> > 
> > ../test_dns_lookup: lookup yandex.ru type MX flags 2
> > ../test_dns_lookup: dns_query: yandex.ru (MX): OK
> > ../test_dns_lookup: warning: valid_hostname: invalid character
> > 6(decimal): ?yande.?r ../test_dns_lookup: warning: malformed domain
> > name in resource name of MX record
> > for ?yande.?r: ?yande.?r ../test_dns_lookup: fatal: Name service
> > error for name=yandex.ru type=MX: Malformed or unexpected name
> > server reply
> > 
> > ../test_dns_lookup: lookup ya.ru type MX flags 2
> > ../test_dns_lookup: dns_query: ya.ru (MX): OK
> > ../test_dns_lookup: warning: valid_hostname: invalid character
> > 2(decimal): ?y.?r ../test_dns_lookup: warning: malformed domain
> > name in resource name of MX record
> > for ?y.?r: ?y.?r ../test_dns_lookup: fatal: Name service error for
> > name=ya.ru type=MX: Malformed or unexpected name server reply
> > 
> > temp buffer at src/dns/dns_lookup.c:287 is messed up with these.
> 
> I believe this was actually a nasty regression in the dn_expand "fix"
> -- somehow I thought my tests were checking reverse dns, but they
> weren't, and the new code actually had a bad off-by-one error. It
> should be fixed now. Let me know if you're still experiencing
> problems.
> 
> Rich

Yes, it works now. Thanks!

% ./test_dns_lookup mx google.com                                                                                              
./test_dns_lookup: lookup google.com type MX flags 2
./test_dns_lookup: dns_query: google.com (MX): OK
./test_dns_lookup: dns_get_answer: type MX for google.com
./test_dns_lookup: dns_get_answer: type MX for google.com
./test_dns_lookup: dns_get_answer: type MX for google.com
./test_dns_lookup: dns_get_answer: type MX for google.com
./test_dns_lookup: dns_get_answer: type MX for google.com
google.com: fqdn: google.com
google.com: ttl:       600 pref: 50 MX: alt4.aspmx.l.google.com
google.com: ttl:       600 pref: 40 MX: alt3.aspmx.l.google.com
google.com: ttl:       600 pref: 20 MX: alt1.aspmx.l.google.com
google.com: ttl:       600 pref: 10 MX: aspmx.l.google.com
google.com: ttl:       600 pref: 30 MX: alt2.aspmx.l.google.com

% ./test_dns_lookup mx ya.ru                                                                                                   
./test_dns_lookup: lookup ya.ru type MX flags 2
./test_dns_lookup: dns_query: ya.ru (MX): OK
./test_dns_lookup: dns_get_answer: type MX for ya.ru
ya.ru: fqdn: ya.ru
ya.ru: ttl:      6580 pref: 10 MX: mx.yandex.ru


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-08-25  8:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 18:19 dn_expand() confuses postfix orc
2013-08-13 18:38 ` Rich Felker
2013-08-13 19:09   ` orc
2013-08-13 20:36     ` Rich Felker
2013-08-14 22:06 ` Rich Felker
2013-08-15  6:14   ` orc
2013-08-15  6:36     ` Rich Felker
2013-08-25  6:43     ` Rich Felker
2013-08-25  8:42       ` orc

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).