Project

General

Profile

Actions

Bug #10116

closed

gem with extension but without lib dir gets installed with a lib dir with wrong permissions

Added by robertgrimm (Robert Grimm) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.2p95 (2014-05-08 revision 45877) [amd64-freebsd10]
[ruby-core:64232]

Description

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.

Updated by robertgrimm (Robert Grimm) over 10 years ago

On FreeBSD, "gem" winds up using /usr/local/lib/ruby/site_ruby/2.1/rubygems/ext/ext_conf_builder.rb which is slightly different than the ext_conf_builder.rb that's in the source. Specifically, it doesn't have the section that appears to properly create the lib dir and instead simply renames the temp dir to the lib dir.

I tested this in the latest Ubuntu and it works fine.

Updated by zzak (zzak _) over 10 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0