Crash in gethostbyname() on congruent usage

u-uclibc-cmdy at aetey.se u-uclibc-cmdy at aetey.se
Wed Dec 12 19:11:55 UTC 2012


Hello Rich,

On Wed, Dec 12, 2012 at 12:05:55PM -0500, Rich Felker wrote:
> uClibc. If you want to lookup hostnames, you use getaddrinfo. If
> that's doing something other than straight DNS, that's because the
> administrator has a damn good reason to want hostname lookups to be
> performed in some other way, and it's not an application's business to
> try to circumvent that.

With all respect, it is a quite questionable statement.

I would rather say "it is not the _host_ administrator business
to guess what my _application_ needs".

When my program looks for DNS, it means DNS, not any local hacks
pretending to know what the host name space "should" look like. Thanks
Heaven DNS is quite near being a global name space, don't cripple it.

Seriously, I know how useful "local hacks" can be, but they remain hacks
anyway. That is, I can not buy that the "damn good" reasons are good.

It's a shame that the tradition confused the global name service
with the local ones.

For the record, I am using a patched version of uClibc which is run-time
configurable (per process, not per host) concerning most of the usually
hardcoded paths like "/etc/hosts" or "/etc/passwd".  This is extremely
useful and sometimes the only way to let a program function sanely
(despite the choices and guesses of the local administrator or OS
provider).

(setuid can be safely done with such a library too, by small setuid
wrappers which contain hardcoded values for the runtime configuration
variables and run the target binaries)

RL



More information about the uClibc mailing list