[Mono-dev] UnixUserInfo issues in OpenBSD

Robert Nagy robert at openbsd.org
Sun Oct 17 09:23:12 EDT 2010


I am going to have a look at this.

On (2010-10-13 12:56), Jonathan Pryor wrote:
> On Wed, 2010-10-13 at 16:38 +0200, pablosantosluac at terra.es wrote:
> > This is what I get:
> > 
> > $ ./a.out tester
> > # checking return value 1; errno=13
> 
> That's...horribly wrong.
> 
> First, what's errno=13?  (i.e. what EVALUE is 13?  I'm sure OpenBSD has
> different values than Linux does.)
> 
> Regardless, OpenBSD doesn't appear to be conforming to the standard
> here:
> 
>         http://www.opengroup.org/onlinepubs/009695399/functions/getpwnam_r.html
> 
>         If successful, the getpwnam_r() function shall return zero;
>         otherwise, an error number shall be returned to indicate the
>         error. 
> 
> The value '1' is likely not the correct errno for ERANGE (Under Linux,
> EPERM has the value 1), and since the return value isn't -1
> recheck_range() won't check errno against ERANGE either.
> 
> However, this does point out a bug in MonoPosixHelper: if getpwnam_r()
> returns non-zero it should treat it as an error, which is clearly not
> happening here (and is why we're printing garbage data to the screen).
> 
> This would only marginally help you, though, as it would result in no
> users being found, ever.
> 
> The fundamental problem is that Mono_Posix_Syscall_getpwnam_r()'s logic
> for checking for ERANGE (so it'll resize the buffer and try the call
> again) is failing under OpenBSD, and from what I can see here the
> problem is within OpenBSD, not MonoPosixHelper.
> 
> Patches welcome to properly support OpenBSD. :-)
> 
>  - Jon
> 
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list


More information about the Mono-devel-list mailing list