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

ruby-changes:59655

From: Nobuyoshi <ko1@a...>
Date: Thu, 9 Jan 2020 15:59:18 +0900 (JST)
Subject: [ruby-changes:59655] b0e9db65c3 (master): Include the standard `id` command output

https://git.ruby-lang.org/ruby.git/commit/?id=b0e9db65c3

From b0e9db65c3f05e1443c2d8f4ca139182a771500c Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 9 Jan 2020 15:57:10 +0900
Subject: Include the standard `id` command output

On macOS, GNU coreutils `id` is limited to NGROUPS_MAX groups,
because of the backward compatibility of getgroups(2).

diff --git a/spec/ruby/core/process/groups_spec.rb b/spec/ruby/core/process/groups_spec.rb
index cbbe4fe..33e0f9d 100644
--- a/spec/ruby/core/process/groups_spec.rb
+++ b/spec/ruby/core/process/groups_spec.rb
@@ -4,6 +4,10 @@ describe "Process.groups" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/groups_spec.rb#L4
   platform_is_not :windows do
     it "gets an Array of the gids of groups in the supplemental group access list" do
       groups = `id -G`.scan(/\d+/).map { |i| i.to_i }
+      # Include the standard `id` command output.  On macOS, GNU
+      # coreutils `id` is limited to NGROUPS_MAX groups, because of
+      # the backward compatibility of getgroups(2).
+      (groups |= `/usr/bin/id -G`.scan(/\d+/).map { |i| i.to_i }) rescue nil
       gid = Process.gid
 
       expected = (groups.sort - [gid]).uniq.sort
-- 
cgit v0.10.2


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

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