[Mono-dev] UnixUserInfo issues in OpenBSD

Jonathan Pryor jonpryor at vt.edu
Wed Oct 13 09:29:06 EDT 2010


I have no idea why it's failing.  Sorry.

What I can do is send you a C program which closely mirrors what
Mono.Unix is doing.  Could you compile and run it, and see if it fails
in the same ways?  The program source is attached.

 - Jon

On Wed, 2010-10-13 at 10:43 +0200, pablosantosluac at terra.es wrote:
> Hi all,
> 
> The following simple program fails on OpenBSD:
> 
> using System;
> using Mono.Unix;
> 
> public class Info
> {
> 
>         public static void Main()
>         {
>                 Console.WriteLine(Environment.UserName);
>                 Console.WriteLine(new
> UnixUserInfo(Environment.UserName).UserName);
>                 Console.WriteLine(UnixUserInfo.GetRealUser().UserName);
>         }
> }
> 
> 
> Environment.UserName retrieves the right user.
> 
> 
> The two next calls fail saying "invalid param":
> 
>   Console.WriteLine(new UnixUserInfo(Environment.UserName).UserName);
>   Console.WriteLine(UnixUserInfo.GetRealUser().UserName);
> 
> It seems the problem is the return of the native method getpwuid_r, that
> returns 1 instead of 0.
> 
> I tried running as root to (suspected it could be a permissions issue)
> but I get the same result.
> 
> I thought it could be related to an old issue with UnixGroupInfo which
> fails if the groups are incorrectly defined (have unexisting users) but
> I think this time my config files are correctly set... :O
> 
> Thanks,
> 
> pablo
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gn.c
Type: text/x-csrc
Size: 1200 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101013/fed761b6/attachment.bin 


More information about the Mono-devel-list mailing list