Help!
Running .NET CORE on Linux.
I am having problems opening a file that I have read-access permissions to based on a secondary group in Linux. In order to test this, I simply execute the Linux command "id" for the current user:
var proc = new System.Diagnostics.Process();
proc.StartInfo.UserName = "JohnNonRootUser";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName = "id";
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
while (!proc.StandardOutput.EndOfStream)
{
sb.AppendLine(proc.StandardOutput.ReadLine());
}
var resID = sb.ToString();
Teh result is :
uid=1002(JohnNonRootUser) gid=1002(JohnNonRootUser) groups=1002(JohnNonRootUser)
But if I do it manually from the command line, it is correctly:
JohnNonRootUser@mybox:/$ id
uid=1002(JohnNonRootUser) gid=1002(JohnNonRootUser) groups=1002(JohnNonRootUser),1003(SomeOtherGroup)
Can anyone let me know how I can get around this please?