Skip to content

Commit

Permalink
Amend permissions for public tools path
Browse files Browse the repository at this point in the history
  • Loading branch information
ngetahun committed Nov 20, 2023
1 parent 7d20dfe commit 007bc0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package/files/update_rmt_app_dir_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ IFS=" "

app_dir=$1
app_dir_ownership=$(stat -c "%U %G" $app_dir)
skip_public_tools="tools"

if [[ $app_dir_ownership == "_rmt nginx" ]]; then
# Sort application directory ordered by directory depth to
# ensure secure recursive ownership change.
find -P $app_dir -type d ! -name $skip_public_tools | ruby -e 'dirs=readlines; dirs.each { |dir| puts("#{dir.strip} #{dir.strip.length}") }' | sort -k 2 -n | awk '/ / {print $1}' | xargs -I {} chown -h root:root {}
find -P $app_dir -type d | ruby -e 'dirs=readlines; dirs.each { |dir| puts("#{dir.strip} #{dir.strip.length}") }' | sort -k 2 -n | awk '/ / {print $1}' | xargs -I {} chown -h root:root {}

find -P $app_dir -type f -user _rmt -group nginx | xargs -I {} chown -h root:root {}
fi
Expand Down
2 changes: 1 addition & 1 deletion package/obs/rmt-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ chrpath -d %{buildroot}%{lib_dir}/vendor/bundle/ruby/*/extensions/*/*/mysql2-*/m

%files
%attr(0755,root,root) %{app_dir}
%attr(0755,root,%{rmt_group}) %{app_dir}/public/tools
%attr(0755,root,root) %{app_dir}/public/tools
%exclude %{app_dir}/engines/
%exclude %{app_dir}/package/
%exclude %{app_dir}/rmt/tmp
Expand Down

0 comments on commit 007bc0e

Please sign in to comment.