Skip to content

Commit d543bc1

Browse files
committed
Remove world writable files from OOD packaged gems
Fixes #4712
1 parent 5320615 commit d543bc1

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

packaging/rpm/ondemand.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ touch %{_localstatedir}/www/ood/apps/sys/myjobs/tmp/restart.txt
341341
%{_tmpfilesdir}/ondemand-nginx.conf
342342

343343
%files -n %{gems_name}
344+
%defattr(644, root, root, 755)
344345
%{gem_home}/*
345346

346347
%files -n ondemand-gems

spec/e2e/00_package_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,8 @@
107107
it { is_expected.to be_owned_by('root') }
108108
it { is_expected.to be_grouped_into('root') }
109109
end
110+
111+
describe command("find #{ood_gems_path} -perm /002") do
112+
its(:stdout) { is_expected.to be_empty }
113+
end
110114
end

spec/e2e/e2e_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ def apache_log_dir
103103
"/var/log/#{apache_service.split('-').first}"
104104
end
105105

106+
def ood_gems_path
107+
case host_inventory['platform']
108+
when 'redhat'
109+
return '/opt/ood/ondemand/root/usr/share/gems'
110+
when 'ubuntu', 'debian'
111+
return '/opt/ood/gems'
112+
end
113+
end
114+
106115
def install_packages(packages)
107116
on hosts, "#{packager} install -y #{packages.join(' ')}"
108117
end

0 commit comments

Comments
 (0)