Project

General

Profile

Actions

Backport #7886

closed

Not recognizing unix group permissions for Mac OS X (Mountain Lion) when user account have >16 groups

Added by afazio (Alfred Fazio) about 11 years ago. Updated about 11 years ago.


Description

The following bug occurs in 1.9.3 p374 and also in 1.8.7 p371

When using a Active Directory mobile account in Mac OS X (only tested thus far with Mountain Lion), Ruby does not honor Unix group membership when testing file permissions.

Let me give an example:

% whoami
afazio

I am in the "rvm" group:

% groups
rvm

Let's create a simple file:

% touch test-file
% sudo chown root:rvm test-file
% sudo chmod 660 test-file

% ls -l test-file
-rw-rw---- 1 root rvm 4 Feb 19 11:43 test-file

At this moment only root and members of "rvm" group can modify test-file

OS recognizes I have correct permissions:

% echo "test data" >> test-file
% cat test-file
test data

However, Ruby does not:

% irb
1.9.3-p374 :001 > File.exists?("test-file")
=> true
1.9.3-p374 :002 > File.writable?("test-file")
=> false

To further illustrate, I can write to this file in Ruby:

pry(main)> File.open("test-file", "w") do |f|
pry(main)* f.write("wee")
pry(main)* end
3
pry(main)> quit

% cat test-file
wee


Files

ruby-rb_group_member-ngroups.patch (345 Bytes) ruby-rb_group_member-ngroups.patch afazio (Alfred Fazio), 02/21/2013 06:04 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0