Skip to content

Commit

Permalink
Fix cloudstack-ui package: bad directory permissions and missing WEB-…
Browse files Browse the repository at this point in the history
…INF (apache#8568)

* Fix bad perms on sub directories for webapp asset files

Updated the spec file such that directories are chmod 0755 rather than 0644 which would prevent the cloud user from reading their contents.

* Fix bad permissions for centos8 UI files, missing WEB-INF

The cloudstack-ui package should have the same files as the bundled webapp in the management package.

* Fix bad perms and missing WEB-INF for centos7 ui rpm

Add the missing WEB-INF directory and do not set directories to 0755.

* Fix missing WEB-INF on CentOS 8 cloudstack-ui rpm

* Fix missing WEB-INF on CentOS 7 cloudstack-ui rpm
  • Loading branch information
kohrar authored Feb 8, 2024
1 parent 69e8ebc commit 3fa052c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packaging/centos7/cloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/templates/systemvm/md5sum
# UI
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/ui
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/
cp -r client/target/classes/META-INF/webapp/WEB-INF ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui
cp ui/dist/config.json ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/ui/
cp -r ui/dist/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/
rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/config.json
Expand Down Expand Up @@ -658,7 +659,7 @@ pip3 install --upgrade urllib3

%files ui
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/ui/config.json
%attr(0644,root,root) %{_datadir}/%{name}-ui/*
%{_datadir}/%{name}-ui/*
%{_defaultdocdir}/%{name}-ui-%{version}/LICENSE
%{_defaultdocdir}/%{name}-ui-%{version}/NOTICE

Expand Down
3 changes: 2 additions & 1 deletion packaging/centos8/cloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/templates/systemvm/md5sum
# UI
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/ui
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/
cp -r client/target/classes/META-INF/webapp/WEB-INF ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui
cp ui/dist/config.json ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/ui/
cp -r ui/dist/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/
rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}-ui/config.json
Expand Down Expand Up @@ -636,7 +637,7 @@ pip install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz

%files ui
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/ui/config.json
%attr(0644,root,root) %{_datadir}/%{name}-ui/*
%{_datadir}/%{name}-ui/*
%{_defaultdocdir}/%{name}-ui-%{version}/LICENSE
%{_defaultdocdir}/%{name}-ui-%{version}/NOTICE

Expand Down

0 comments on commit 3fa052c

Please sign in to comment.