-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SUSTAIN-782] Fix permissions on gemfiles created with strict umask on reconfigure #1431
Conversation
039ef07
to
bf3f14f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good, modulo the executable flag issue.
# The GEM_PATH should work since we allow only one version of ruby to be installed. | ||
GEM_PATH="#{LIB_PATH}/ruby/gems/*/gems" | ||
|
||
execute "find #{GEM_PATH} -executable -exec chmod 755 {} \\;" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From some very brief research, it looks like the -executable flag may only appear in findutils 4.4. It looks like Centos 5 ships 4.2.27 or such, and we still are building Centos 5 images for chef-server. Perhaps find . -perm /u=x,g=x,o=x
? (Actually, just u=x might be fine here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! and we do support el-5, got the tests to fail due to this error.
9c2fde0
to
6896f09
Compare
…n a reconfigure. Gems installed with any umask stricter than 022 can bring in more deps that also get installed with stricter permissions. Once such example was with the knife-tidy / knife-ec2-backup installed with strict permissions caused some of the gems to be inaccessible to the depsolver, causing erchef failures that were very hard to trace. Fixes permissions on gems installed despite a strict umask, to avoid failures. Signed-off-by: Prajakta Purohit <[email protected]>
6896f09
to
e958f7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Currently if a user installs gems with a umask stricter than 022, the opscode user does not have sufficient privileges to read them.
This with certain gems causes the reconfigure to fail.
This PR tries to make sure that the
/opt/opscode/embedded/lib/ruby/gems
permissions are lenient enough for the opscode user to be able to read.rake and knife-tidy gems installed with 077 umask.
reconfigure
fixed permissions:
http://wilson.ci.chef.co/job/chef-server-trigger-ad_hoc/35/downstreambuildview/
Signed-off-by: Prajakta Purohit [email protected]