Issue #10116 has been updated by Zachary Scott.

Status changed from Open to Closed

----------------------------------------
Bug #10116: gem with extension but without lib dir gets installed with a lib dir with wrong permissions
https://bugs.ruby-lang.org/issues/10116#change-48242

* Author: Robert Grimm
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [amd64-freebsd10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
When installing a ruby gem that has a C extension but not an explicit lib directory, the created lib directory will have a lib directory that's only readable by root causing non-root users to not be able to load the gem.  That is, the permissions will be 700 instead of 755.  The bug appears to be in Gem::Ext::ExtConfBuilder.build.  A tmp directory is created, that might have 700 permissions.  If the "destent" (lib) doesn't exist, it will rename the tmp directory to "desent" without altering its permissions.

An example gem that exhibits this behavior is the "absolute_time" gem (https://rubygems.org/gems/absolute_time).  I've only tried this on FreeBSD.  When using RVM on OSX at least, the permissions are correct.



-- 
https://bugs.ruby-lang.org/