From 360b6744a2b4e3d1248fbf1b55299f4dc7d2ea62 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 21 Dec 2020 22:14:40 +0100 Subject: [PATCH 1/2] according to https://man7.org/linux/man-pages/man2/getgroups.2.html it's not specified if this group is included in the list returned by getgroups --- .../System.Diagnostics.Process/tests/ProcessTests.Unix.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs index 99272c05f0c2e3..a6d204d2e502c9 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs @@ -923,7 +923,11 @@ private static unsafe HashSet GetGroups() } // Return this as a HashSet to filter out duplicates. - return new HashSet(groups.Slice(0, rv).ToArray()); + var result = new HashSet(groups.Slice(0, rv).ToArray()); + // according to https://man7.org/linux/man-pages/man2/getgroups.2.html it's not specified + // if this group is included in the list returned by getgroups + result.Add(getegid()); + return result; } } From b9525b05d4cc05b3f4c4d628c388e7c4f06a8372 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 22 Dec 2020 01:43:18 +0100 Subject: [PATCH 2/2] I forgot to re-enable the failing test. I am very stupid --- .../System.Diagnostics.Process/tests/ProcessTests.Unix.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs index a6d204d2e502c9..59a24f55a0fd39 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs @@ -541,8 +541,7 @@ private static int CheckUserAndGroupIds(string userId, string groupId, string gr } [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/28922", TestPlatforms.AnyUnix)] - public unsafe void TestCheckChildProcessUserAndGroupIds() + public void TestCheckChildProcessUserAndGroupIds() { string userName = GetCurrentRealUserName(); string userId = GetUserId(userName);