From 235c07063ce1db3a9c42958031a33cb092d7dd43 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 24 Jul 2020 15:32:13 -0400 Subject: [PATCH] Adjust SELinux context on remote exec To facilitate firstboot, context must be changed before execing remote content. --- confluent_osdeploy/el7/profiles/default/scripts/functions | 3 +++ confluent_osdeploy/el8/profiles/default/scripts/functions | 3 +++ confluent_osdeploy/rhvh4/profiles/default/scripts/functions | 3 +++ 3 files changed, 9 insertions(+) diff --git a/confluent_osdeploy/el7/profiles/default/scripts/functions b/confluent_osdeploy/el7/profiles/default/scripts/functions index 812f77c3..3bd74083 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/functions +++ b/confluent_osdeploy/el7/profiles/default/scripts/functions @@ -3,6 +3,9 @@ run_remote() { curl -f https://$mgr/confluent-public/os/$profile/scripts/$1 > $1 chmod +x $1 cmd=$1 + if [ -x /unr/bin/chcon ]; then + chcon system_u:object_r:bin_t:s0 $cmd + fi shift ./$cmd $* cd - diff --git a/confluent_osdeploy/el8/profiles/default/scripts/functions b/confluent_osdeploy/el8/profiles/default/scripts/functions index 812f77c3..3bd74083 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/functions +++ b/confluent_osdeploy/el8/profiles/default/scripts/functions @@ -3,6 +3,9 @@ run_remote() { curl -f https://$mgr/confluent-public/os/$profile/scripts/$1 > $1 chmod +x $1 cmd=$1 + if [ -x /unr/bin/chcon ]; then + chcon system_u:object_r:bin_t:s0 $cmd + fi shift ./$cmd $* cd - diff --git a/confluent_osdeploy/rhvh4/profiles/default/scripts/functions b/confluent_osdeploy/rhvh4/profiles/default/scripts/functions index 812f77c3..3bd74083 100644 --- a/confluent_osdeploy/rhvh4/profiles/default/scripts/functions +++ b/confluent_osdeploy/rhvh4/profiles/default/scripts/functions @@ -3,6 +3,9 @@ run_remote() { curl -f https://$mgr/confluent-public/os/$profile/scripts/$1 > $1 chmod +x $1 cmd=$1 + if [ -x /unr/bin/chcon ]; then + chcon system_u:object_r:bin_t:s0 $cmd + fi shift ./$cmd $* cd -