mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Re: Would love to see reconsideration for domain and search
Date: Sun, 25 Oct 2015 15:08:46 -0400	[thread overview]
Message-ID: <20151025190846.GB8645@brightrain.aerifal.cx> (raw)
In-Reply-To: <CA+MmhbMmsOp5hmfSJZoT3DGL+FcQKqMBS7RGHwU7EKKLraZtgg@mail.gmail.com>

On Sun, Oct 25, 2015 at 02:06:29PM +0100, Jan Broer wrote:
> > The only place adding search support might negatively impact existing
> > musl users is by causing hostnames with no dots to be queried with the
> > (often useless and unwanted) default domain set by dhcp before
> > failing. My preference would probably be having musl default to
> > ndots=0 rather than ndots=1 so that search has to be enabled
> > explicitly. Are there any reasons this would be undesirable?
> 
> 
> I don't think it is a good idea do default to ndots=0. This would
> essentially break search for systems where resolv.conf values are managed
> by the DHCP server. DHCP expects search to work when there is at least one
> entry in the domain-search option returned by the DHCP server. There is no
> DHCP option for configuring ndots (see
> http://linux.die.net/man/5/dhcp-options) and therefore search would not
> work in these configurations when ndots defaults to 0.

What I've found is that almost all dhcp setups include a search
domain, and dhcp clients set it in resolv.conf, but it's rare that the
user actually wants to search this domain. For example do Comcast
(random ISP to pick on) customers actually want random bare (no
domain) queries like "foo" to be tried as "foo.comcast.com"? Almost
surely not.

Of course, as noted before, only bare queries are affected if ndots=1,
so the only behavioral change is that some such queries may
unexpectedly succeed (if they exist in the search domain) or take
longer to fail (since two or more queries have to fail).

> Also, i don't think your argument for setting ndots to 0 by default is
> valid:
> 
> Search always to be enabled explicitly even when the default for ndots=1:
> There is no search unless the user explicitely writes search paths in his
> resolv.conf or configures his DHCP client to get the domain-search option
> via DHCP.
> 
> So the resolvers search functionality is already something the user has to
> enable explicitely.

My experience is that dhcp clients do this by default. Of course
there's a good argument to be made that fixing this should be done at
the dhcp client level (or resolv.conf updating system level) rather
than having libc try to 'fix' it. There's certainly value to having
consistent behavior between programs using different libcs on the same
system, so perhaps sticking with ndots=1 is better.

Rich


  parent reply	other threads:[~2015-10-25 19:08 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 21:24 Tim Hockin
2015-10-22 21:56 ` Rich Felker
2015-10-22 22:36   ` Tim Hockin
2015-10-22 23:00     ` Josiah Worcester
2015-10-22 23:37       ` Tim Hockin
2015-10-23  4:27         ` Rich Felker
2015-10-23  5:13           ` Tim Hockin
2015-10-23  5:31             ` Rich Felker
2015-10-23  5:37               ` Tim Hockin
2015-10-23  6:00                 ` Rich Felker
2015-10-23  6:04                   ` Tim Hockin
2016-01-29  0:57                 ` Rich Felker
2015-10-27  0:30               ` Rich Felker
2015-10-27  0:37                 ` Tim Hockin
2015-10-27  0:45                   ` Rich Felker
2015-10-27  8:11                 ` u-uy74
2015-11-28 22:48                 ` Jan Broer
2015-11-28 23:20                   ` Rich Felker
2015-11-29  3:06                     ` Jan Broer
2016-01-29  0:58                   ` Rich Felker
2015-10-26  2:14           ` Re: Would not " John Levine
2015-10-26  5:14             ` Tim Hockin
2015-10-26 16:16               ` Rich Felker
2015-10-26 17:41                 ` John Levine
2015-10-26 18:08                   ` Rich Felker
2015-10-23  8:12       ` Re: Would " u-uy74
2015-10-23  9:35         ` Laurent Bercot
2015-10-23 12:23           ` Laurent Bercot
2015-10-23 15:57           ` Tim Hockin
2015-10-23  5:26 ` Kurt H Maier
2015-10-24 21:33   ` Tim Hockin
2015-10-24 21:57     ` Kurt H Maier
2015-10-24 23:31       ` Rich Felker
2015-10-24 22:02     ` Rich Felker
2015-10-24 22:32       ` Tim Hockin
2015-10-25  8:20       ` u-uy74
2015-10-25 13:06       ` Jan Broer
2015-10-25 13:19         ` u-uy74
2015-10-25 13:39           ` Jan Broer
2015-10-25 14:08             ` u-uy74
2015-10-25 19:08         ` Rich Felker [this message]
2015-10-26  1:26       ` Isaac Dunham
2015-10-26 15:35         ` Rich Felker
2015-10-23 15:30 Jan Broer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151025190846.GB8645@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).