System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

getpwnam_r returns null though the user present in Active Directory and it returns

 
Highlighted
Visitor

getpwnam_r returns null though the user present in Active Directory and it returns

Hi All,

I find getpwnam_r returns null, though the user avaialbe in Active Directory  and also I find in wireshark Active Directory has returned user detail as a response to ldap search made by getpwnam_r. It would be really helpful if I get to now what is going wrong there.

I am using nss-ldap and pam-ldap modules for authenticaiton.

When I tried getent passwd ldapuser this also does not return the user.

2 REPLIES 2
Highlighted
Advisor

Re: getpwnam_r returns null though the user present in Active Directory and it returns

Not sure which linux version you are using, might be this article helpful...

https://bugzilla.redhat.com/show_bug.cgi?id=988068

Highlighted
Visitor

Re: getpwnam_r returns null though the user present in Active Directory and it returns

Thanks for  your  reply. The  bugzilla reference you  have provided thats related to user does not exist in LDAP Store. But mine is littel  bit different.  I could find the user is  present in Active Directory and  also using strace I found  getpwnam_r reads the user  attributes and also confirmed  using wireshark when LDAP server responded back with required attributes for that user to getpwnam_r ldap search request. But getpwnam_r returns NULL and error was set to 0. 

So it would be great help if I get to known what all being checked by getpwnam_r after receiving data and when does it return NULL and error 0.

By   the way  I am using glibc-2.30 .  I wrote a small test program using getpwnam_r there also I find the same behaviour.