Skip to content

Commit 3014bc3

Browse files
authored
Merge pull request #4732 from OSC/rm-world-write-4.0
Remove world writable from files in OOD packaged gems (release 4.0)
2 parents 35dbcd8 + 04741b9 commit 3014bc3

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

packaging/deb/rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ override_dh_auto_install:
4848
# install gems
4949
mkdir -p $(DESTDIR)/opt/ood/gems
5050
mv $(GEM_HOME)/* $(DESTDIR)/opt/ood/gems
51+
chmod -R o-w $(DESTDIR)/opt/ood/gems
5152

5253
# make some directories
5354
mkdir -p "$(APACHE_DIR)/public/maintenance"

packaging/rpm/ondemand.spec

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

340340
%files -n %{gems_name}
341+
%defattr(644, root, root, 755)
341342
%{gem_home}/*
342343

343344
%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 ! -type l -exec ls -la {} \\;") 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
@@ -105,6 +105,15 @@ def apache_log_dir
105105
"/var/log/#{apache_service.split('-').first}"
106106
end
107107

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

spec/e2e/nodesets/amzn2023.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ HOSTS:
44
- agent
55
platform: el-9-x86_64
66
hypervisor: docker
7-
image: amazonlinux:2023
7+
image: amazonlinux:2023.8.20250908.0
88
docker_preserve_image: true
99
docker_cmd:
1010
- '/usr/sbin/init'

0 commit comments

Comments
 (0)