[Mono-dev] [PATCH] Bug in Mono.Posix handling '+::::::' entry in /etc/passwd

Ian Dichkovsky ianpro at gmail.com
Thu Apr 30 10:45:04 EDT 2009


Hello,


Robert Jordan wrote:
> 
> Jonathan Pryor wrote:
>> Perhaps I'm mis-reading that, but it implies to me that if NIS is
>> configured properly getpwent(3) should actually return NIS entries, not
>> return the '+:...' record from /etc/passwd directly.  (Does anybody have
>> NIS setup to see what getpwent(3) actually does?)
> 
> On a well configured Linux NIS client, those entries are invisible
> to getpwent. My mono machines are all NIS clients and I've never
> seen this unit test failing.
> 
>> In any event, I believe it's a Bad Idea (TM) for
>> UnixUserInfo.GetLocalUsers() to start skipping entries that getpwent(3)
>> is returning.  If a user should be skipped, then the code calling
>> UnixUserInfo.GetLocalUsers() should skip it, otherwise we're silently
>> dropping data in a difficult-to-debug manner.
> 
> I agree.
> 
> Robert
> 

Thank you for the advices.
We have discussed NIS configuration with our SA gang. They changed line in
/etc/nsswitch.conf from
passwd:      files nis
to
passwd:      compat

In this case test NonReentrantSyscalls passed successfully.

Beside that we tried to return to "passwd:      files nis" and play a bit
with functions getpwent() and getpwnam().
While getpwent() returns user "+" at the same time getpwnam("+") returns
NULL-pointer and errno is set to 0.
Man says, that this is a correct behavior of getpwnam() in case of missing
user.
So, do we accept this behavior of getpwnam("+") and should fix the sources
of test or leave it with configuration workaround?

Regards,
Ian
-- 
View this message in context: http://www.nabble.com/-PATCH--Bug-in-Mono.Posix-handling-%27%2B%3A%3A%3A%3A%3A%3A%27-entry-in--etc-passwd-tp23254974p23317577.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list