Skip to content

Commit

Permalink
Merge pull request #460 from atc0005/use-restorecon-instead-of-chcon
Browse files Browse the repository at this point in the history
Update RPM postinstall scripts to use restorecon
  • Loading branch information
atc0005 authored Jul 11, 2023
2 parents 8f75c4b + 7b3ede7 commit 42eafcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions packages/dev/scripts/rpm/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ if [ -x "$(command -v selinuxenabled)" ]; then
do

echo -e "\tApplying SELinux contexts on ${plugin_path}/${plugin_name}${plugin_name_suffix}"

chcon \
--verbose \
-t nagios_unconfined_plugin_exec_t \
-u system_u \
-r object_r \
"${plugin_path}/${plugin_name}${plugin_name_suffix}"
restorecon -v ${plugin_path}/${plugin_name}

if [ $? -eq 0 ]; then
echo -e "\t[OK] Successfully applied SELinux contexts on ${plugin_path}/${plugin_name}${plugin_name_suffix}"
Expand Down
8 changes: 1 addition & 7 deletions packages/stable/scripts/rpm/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ if [ -x "$(command -v selinuxenabled)" ]; then
do

echo -e "\tApplying SELinux contexts on ${plugin_path}/${plugin_name}${plugin_name_suffix}"

chcon \
--verbose \
-t nagios_unconfined_plugin_exec_t \
-u system_u \
-r object_r \
"${plugin_path}/${plugin_name}${plugin_name_suffix}"
restorecon -v ${plugin_path}/${plugin_name}

if [ $? -eq 0 ]; then
echo -e "\t[OK] Successfully applied SELinux contexts on ${plugin_path}/${plugin_name}${plugin_name_suffix}"
Expand Down

0 comments on commit 42eafcc

Please sign in to comment.