summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index ec59c8eb30..bb34e22454 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1644,7 +1644,15 @@ class TestProcess < Test::Unit::TestCase
assert_nothing_raised(feature6975) do
begin
g = IO.popen([RUBY, "-e", "print Process.gid", gid: group], &:read)
- assert_equal(gid, g, feature6975)
+ # AIX allows a non-root process to setgid to its supplementary group,
+ # while other UNIXes do not. (This might be AIX's violation of the POSIX standard.)
+ # However, Ruby does not allow a setgid'ed Ruby process to use the -e option.
+ # As a result, the Ruby process invoked by "IO.popen([RUBY, "-e", ..." above fails
+ # with a message like "no -e allowed while running setgid (SecurityError)" to stderr,
+ # the exis status is set to 1, and the variable "g" is set to an empty string.
+ # To conclude, on AIX, if the "gid" variable is a supplementary group,
+ # the assert_equal next can fail, so skip it.
+ assert_equal(gid, g, feature6975) unless $?.exitstatus == 1 && /aix/ =~ RUBY_PLATFORM && gid != Process.gid
rescue Errno::EPERM, NotImplementedError
end
end