On 05/07/09 22:37, Victor Duchovni wrote:
> On Sun, Jul 05, 2009 at 07:45:31PM +1000, Barney Desmond wrote:
>
>>> "The command "getent passwd <user>" returns the expected values for both
>>> users. However
>>> "postmap -q <user> unix:passwd.byname" returns a result only for user pms.
>> This is expected - [...]
>
> No, this is not "expected". The "passwd.byname" lookup result is exactly
> the result of the C-library getpwnam(3). If this is not working, that's
> the problem. The output of
>
> getent passwd user
> and
> postmap -q user unix:passwd.byname
>
> must be the same, or the underlying system is broken in some fashion.
> The example below shows the two commands producing *identical* output,
> hence a count of "2" from "uniq -c":
>
> $ (getent passwd viktor
> postmap -q viktor unix:passwd.byname) |
> sort |
> uniq -c |
> awk '{print $1}'
> 2
>
> The tests must be done as a non-root user to make sure that file
> permissions don't restrict getpwnam(3) to the super-user.
>
# user with ldap entry only:
[...@homer domestic]$ (getent passwd bells; postmap -q bells
unix:passwd.byname) | sort | uniq -c | awk '{print $1}'
1
# user with /etc/passwd entry
[...@homer domestic]$ (getent passwd pms; postmap -q pms
unix:passwd.byname) | sort | uniq -c | awk '{print $1}'
2
Any tips on how to dig deeper would be appreciated. Would it be
premature to create a bug report for this?