Subject: Re: nsswitch.conf and irs.conf
To: None <itojun@iijlab.net>
From: Noriyuki Soda <soda@sra.co.jp>
List: tech-net
Date: 01/19/2003 12:53:29
>>>>> On Sun, 19 Jan 2003 10:59:04 +0900, itojun@iijlab.net said:

> 	now you are talking about nsswitch.conf and irs.conf, not thread-
> 	safeness of nsswitch() and irs-related functions.  don't mix the topic
> 	up.

I think I don't mix the topic up.
The nsswitch framework can be thread safe, too.
Look at the implementation of Solaris and Linux.
Those are both thread safe.

The thread safeness is a just man power issue.
Not only switching to the IRS based implementation also requires some
developers' man power, but also it may require users' man power,
because it may make some visible change to our users. So, total wasted
man power with the IRS may be larger than the nsswitch.
IMHO, making visible change to our users without technical requirement
is bad thing, that's why I'm asking.

> 	if we really need to provide backward compatibility to nsswitch.conf,
> 	yes, we have to modify irs library to take care of syntax like
> 	[notfound=return].  however, i'm not really convinced that it is good
> 	to provide that level of flexibility to users.  in what kind of cases
> 	this is useful?  could you provide any usage cases?

Think about the following setting in nsswitch.conf:
	hosts: files nis [unavail=return] dns

This settings may be critical to make sure that addresses which are
maintained locally cannot be forged. (Yes, such assumption is somewhat
legacy, but may be still useful on some conditions.)

BTW, I think the way to implement the thread safeness in the IRS library
is somewhat lame. gethostbyname(3) should be implemented by a call to
gethostbyname_r(3), rather than vice versa as the IRS currently
does. Using a thread local strage may make sesne, if you cannot modify
some intermediate function interfaces. But the IRS library doesn't
have to use the thread local strage in this case, because it is
just an internal implementation, and IRS library is free to choose any
function for the implementation of the thread safeness. Note that
using thread local strage not only makes source code readability worse
(as I misread), it also adds some overhead.
--
soda