[前][次][番号順一覧][スレッド一覧]

ruby-changes:42301

From: naruse <ko1@a...>
Date: Tue, 29 Mar 2016 16:11:37 +0900 (JST)
Subject: [ruby-changes:42301] naruse:r54375 (ruby_2_3): merge revision(s) 54010: [Backport #12154]

naruse	2016-03-29 16:11:32 +0900 (Tue, 29 Mar 2016)

  New Revision: 54375

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54375

  Log:
    merge revision(s) 54010: [Backport #12154]
    
    * test/ruby/test_process.rb (test_execopts_gid): Skip a test
      that is known to fail on AIX. AIX allows setgid to
      a supplementary group, but Ruby does not allow the "-e"
      option when setgid'ed, so the test does not work as intended.

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/test/ruby/test_process.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54374)
+++ ruby_2_3/ChangeLog	(revision 54375)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Tue Mar 29 16:02:26 2016  Rei Odaira  <Rei.Odaira@g...>
+
+	* test/ruby/test_process.rb (test_execopts_gid): Skip a test
+	  that is known to fail on AIX. AIX allows setgid to
+	  a supplementary group, but Ruby does not allow the "-e"
+	  option when setgid'ed, so the test does not work as intended.
+
 Tue Mar 29 15:58:18 2016  Rei Odaira  <Rei.Odaira@g...>
 
 	* test/socket/test_addrinfo.rb (test_ipv6_address_predicates):
Index: ruby_2_3/test/ruby/test_process.rb
===================================================================
--- ruby_2_3/test/ruby/test_process.rb	(revision 54374)
+++ ruby_2_3/test/ruby/test_process.rb	(revision 54375)
@@ -1,3 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_process.rb#L1
+# coding: utf-8
 # frozen_string_literal: false
 require 'test/unit'
 require 'tempfile'
@@ -1812,7 +1813,15 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_process.rb#L1813
       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
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54374)
+++ ruby_2_3/version.h	(revision 54375)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.0"
 #define RUBY_RELEASE_DATE "2016-03-29"
-#define RUBY_PATCHLEVEL 32
+#define RUBY_PATCHLEVEL 33
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r54010


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]