From c4d04d7611efcffdce1610b975a774039e73371b Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Sun, 6 Jul 2025 01:59:12 -0600 Subject: [PATCH] Update the installation script to deal with SELinux --- .github/actions/toast/node_modules/.bin/uuid 2 | 1 + install.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 120000 .github/actions/toast/node_modules/.bin/uuid 2 diff --git a/.github/actions/toast/node_modules/.bin/uuid 2 b/.github/actions/toast/node_modules/.bin/uuid 2 new file mode 120000 index 0000000..588f70e --- /dev/null +++ b/.github/actions/toast/node_modules/.bin/uuid 2 @@ -0,0 +1 @@ +../uuid/dist/bin/uuid \ No newline at end of file diff --git a/install.sh b/install.sh index 0c462a6..d52545b 100755 --- a/install.sh +++ b/install.sh @@ -73,6 +73,14 @@ # Remove the temporary directory. rm -rf "$TEMPDIR" + # If SELinux is installed, apply the default security context to the binary. + # shellcheck disable=SC2024 + if command -v restorecon 2> /dev/null; then + restorecon "$DESTINATION" 2> /dev/null || + sudo restorecon "$DESTINATION" < /dev/tty || + fail 'Failed to set SELinux attributes on the binary.' + fi + # Let the user know if the installation was successful. "$DESTINATION" --version || fail 'There was an error installing the binary.' )