From 88915f34cf2f52e9968eef23ce515f3ba44c5078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 21 Oct 2026 17:42:30 -0300 Subject: [PATCH] fix(netboot): use POSIX firewalld checks in postinstall profiles Use separate test commands under /bin/sh. Remove regular files and symlinks, including dangling links, while retaining absent entries and directories. --- .../xcat/netboot/rh/compute.rhels10.aarch64.postinstall | 8 ++++---- .../xcat/netboot/rh/compute.rhels10.ppc64le.postinstall | 8 ++++---- .../xcat/netboot/rh/compute.rhels10.x86_64.postinstall | 8 ++++---- .../xcat/netboot/rh/compute.rhels8.ppc64le.postinstall | 8 ++++---- .../xcat/netboot/rh/compute.rhels8.x86_64.postinstall | 8 ++++---- .../xcat/netboot/rh/compute.rhels9.ppc64le.postinstall | 8 ++++---- .../xcat/netboot/rh/compute.rhels9.x86_64.postinstall | 8 ++++---- .../netboot/rocky/compute.rocky10.riscv64.postinstall | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.aarch64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.aarch64.postinstall index c5fcc45dfa..be42313772 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.aarch64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.aarch64.postinstall @@ -42,14 +42,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.postinstall index 9028a7b75b..ba8f22b6ae 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.ppc64le.postinstall @@ -43,14 +43,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.x86_64.postinstall index c5fcc45dfa..be42313772 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels10.x86_64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels10.x86_64.postinstall @@ -42,14 +42,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall index 9028a7b75b..ba8f22b6ae 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.postinstall @@ -43,14 +43,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall index c5fcc45dfa..be42313772 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.postinstall @@ -42,14 +42,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.postinstall index 9028a7b75b..ba8f22b6ae 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.postinstall @@ -43,14 +43,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.postinstall index c5fcc45dfa..be42313772 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.postinstall @@ -42,14 +42,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi diff --git a/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.riscv64.postinstall b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.riscv64.postinstall index c69a051426..1e7ea3d54e 100755 --- a/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.riscv64.postinstall +++ b/xCAT-server/share/xcat/netboot/rocky/compute.rocky10.riscv64.postinstall @@ -42,14 +42,14 @@ fi #--for redhat 8 and 8.1 #-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys FIREWALLD="$installroot/etc/systemd/system/multi-user.target.wants/firewalld.service" -if [[ -f "$FIREWALLD" || -L "$FIREWALLD" ]] +if [ -f "$FIREWALLD" ] || [ -L "$FIREWALLD" ] then - rm -f $FIREWALLD + rm -f "$FIREWALLD" fi FIREWALLD1="$installroot/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service" -if [[ -f "$FIREWALLD1" || -L "$FIREWALLD1" ]] +if [ -f "$FIREWALLD1" ] || [ -L "$FIREWALLD1" ] then - rm -f $FIREWALLD1 + rm -f "$FIREWALLD1" fi