From 4a645343a9f510aeedfb9bc2d98f457eef671e4e Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Mon, 24 Jun 2024 17:09:28 +0530 Subject: [PATCH] Give the proper file/directory permissions to the pgAdmin installation directory on RHEL-8. This is the only platform that has write permission for the executable files after installation which is fixed. --- pkg/debian/build.sh | 2 +- pkg/linux/build-functions.sh | 3 ++- pkg/redhat/build.sh | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/debian/build.sh b/pkg/debian/build.sh index 9bb9f2825..a8ec35557 100755 --- a/pkg/debian/build.sh +++ b/pkg/debian/build.sh @@ -21,7 +21,7 @@ _setup_dirs _create_python_virtualenv "debian" _build_runtime _build_docs "debian" -_copy_code +_copy_code "debian" _generate_sbom # diff --git a/pkg/linux/build-functions.sh b/pkg/linux/build-functions.sh index 9d4807e7f..7ee403088 100644 --- a/pkg/linux/build-functions.sh +++ b/pkg/linux/build-functions.sh @@ -212,7 +212,8 @@ _build_docs() { _copy_code() { echo "Copying the server code..." - if [ "$2" == 'redhat' ] && [ "${OS_VERSION}" == "8" ]; then + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F "=" '{ print $2 }' | sed 's/"//g' | awk -F "." '{ print $1 }') + if [ "$1" == 'redhat' ] && [ "${OS_VERSION}" == "8" ]; then echo "Setting file permission through umask..." umask u+rwx,go+rx,go-w fi diff --git a/pkg/redhat/build.sh b/pkg/redhat/build.sh index 712073243..228e75d7d 100755 --- a/pkg/redhat/build.sh +++ b/pkg/redhat/build.sh @@ -25,7 +25,7 @@ _setup_dirs _create_python_virtualenv "redhat" _build_runtime _build_docs "redhat" -_copy_code +_copy_code "redhat" _generate_sbom # Get an RPM-compatible version number @@ -124,6 +124,10 @@ cp -rfa %{pga_build_root}/desktop/* \${RPM_BUILD_ROOT} %files %defattr(-,root,root,755) +%attr(755,root,root) /usr/pgadmin4/bin/setup-web.sh +%attr(755,root,root) /usr/pgadmin4/bin/pgadmin4 +%attr(755,root,root) /usr/pgadmin4/web/pgacloud/pgacloud.py +%attr(755,root,root) /usr/pgadmin4/web/pgadmin/misc/bgprocess/process_executor.py /usr/pgadmin4/bin/* /usr/share/icons/hicolor/128x128/apps/* /usr/share/icons/hicolor/64x64/apps/*