[Mono-dev] UnixUserInfo issues in OpenBSD
pablosantosluac at terra.es
pablosantosluac at terra.es
Wed Oct 13 04:43:43 EDT 2010
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
More information about the Mono-devel-list
mailing list