mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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).
This commit is contained in:
parent
b369f5e8a2
commit
b0e9db65c3
1 changed files with 4 additions and 0 deletions
|
@ -4,6 +4,10 @@ describe "Process.groups" do
|
||||||
platform_is_not :windows do
|
platform_is_not :windows do
|
||||||
it "gets an Array of the gids of groups in the supplemental group access list" 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 }
|
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
|
gid = Process.gid
|
||||||
|
|
||||||
expected = (groups.sort - [gid]).uniq.sort
|
expected = (groups.sort - [gid]).uniq.sort
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue