Set the permissions of chrome-sandbox (#9421)

* Set the permissions of chrome-sandbox

Testing to see if setting the permissions of chrome-sandbox prior to packaging works, or if an RPM post-install script is needed

* use rpm attr to set file permissions

* whitespace fixup
This commit is contained in:
Earle Lowe 2021-12-07 09:58:05 -08:00 committed by GitHub
parent ad7b549cbd
commit e78fef5003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,11 @@ if [ "$REDHAT_PLATFORM" = "x86_64" ]; then
# shellcheck disable=SC2086
sed -i '1s/^/%define _build_id_links none\n%global _enable_debug_package 0\n%global debug_package %{nil}\n%global __os_install_post \/usr\/lib\/rpm\/brp-compress %{nil}\n/' "$NODE_ROOT/lib/node_modules/electron-installer-redhat/resources/spec.ejs"
# Use attr feature of RPM to set the chrome-sandbox permissions
# adds a %attr line after the %files line
# The location is based on the existing location inside spec.ej
sed -i '/^%files/a %attr(4755, root, root) /usr/lib/<%= name %>/chrome-sandbox' "$NODE_ROOT/lib/node_modules/electron-installer-redhat/resources/spec.ejs"
# Updates the requirements for building an RPM on Centos 7 to allow older version of rpm-build and not use the boolean dependencies
# See https://github.com/electron-userland/electron-installer-redhat/issues/157
# shellcheck disable=SC2086