gethostbyname problem ?

Didier Carlier carlierd at acm.org
Thu Jun 3 14:26:08 UTC 2004


Hi,
is there any incompatibility between the gethostby* resolver functions 
and a pam modules ?

What I observe is that if I call gethostbyname() from within a pam 
module, the hostname I'm looking for is only found if the domain it is 
part of is the first one listed in resolv.conf.

To give a small example, suppose I'm looking for a host named "db" 
which exists(dns) in the domain s.foo.com but not in t.foo.com.  If my 
resolv.conf has "search s.foo.com t.foo.com", gethostbyname finds it 
but if resolv.conf contains "search t.foo.com s.foo.com" it does not 
find it.

If I take out that code from the pam module and run it as a 
regularapplication, then gethostbyname always finds the host.

What makes me think the problem/feature could be related to pam is that 
I've noticed pam_ldap.so has the same behaviour: if pam_ldap.conf has 
the line "host ldap", pam_ldap.so only finds ldap.s.foo.com if 
s.foo.com is listed first in resolv.conf.

Am I missing something ?

Best regards,
Didier





More information about the Pam-list mailing list