Bug #10116
closedgem with extension but without lib dir gets installed with a lib dir with wrong permissions
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) about 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 _) about 10 years ago
- Status changed from Open to Closed