> > What is the back-end for your UNIX system account lookups: is this
> > LDAP, files, or something else? This weekend there was a thread
> > about getpwnam_r() not returning errors when an LDAP server was
> > down. Now we have getpwnam_r() returing errors for non-error lookups.
> > If this is the same LDAP driver then it badly needs fixing.
> 
> Below is a small C program. Save as getpwnam_r_test.c, build with
> "make getpwnam_r_test", and run as "./getpwnam_r_test username".
> 
> This is the correct result:
> 
>     $ ./getpwnam_r_test wietse
>     wietse: no error: uid=304252 (Wietse Venema)
>     $ ./getpwnam_r_test +bar
>     +bar: no error: not found
>     $ ./getpwnam_r_test doesnotexist
>     doesnotexist: no error: not found
>     $ ./getpwnam_r_test ''
>     : no error: not found
> 
> As you see, there is no error for non-existent users, even if the
> name is spelled in a funny manner.

Bingo! :-)
On old MTA (Debian sqeeze) your demo program works well
meanwhile on the new one (Debian jessie) it fails:

$ ./getpwnam_r_test +Trash
+Trash: error: No such file or directory
$ 

Unfortunately the situation is bit complicated.

/etc/nsswitch.conf:
passwd:         files ldap

And nsdc also plays in the background. There are several
potentially buggy code everywhere.

Many thanks for your help. :-)
I consult my colleagues what to do.

Cheers

Gabor

Reply via email to