diff --git a/linux-sgx.spec b/linux-sgx.spec index da0706f49533f9c3082e1cd1c6eb7f059b9e4f21..ddc0283677379f38f1bac92b4691de89c8e4bc80 100644 --- a/linux-sgx.spec +++ b/linux-sgx.spec @@ -1,6 +1,6 @@ Name: linux-sgx Version: 2.11.100 -Release: 11 +Release: 12 Summary: Intel(R) Software Guard Extensions for Linux* OS ExclusiveArch: x86_64 License: BSD-3-Clause @@ -811,25 +811,27 @@ echo -e "Installation succeed!" systemctl start mpa_registration_tool.service %postun -n sgx-ra-service -# Generate the script to setup environment variables -MPA_DST_PATH=/opt/intel/sgx-ra-service +if [ "$1" = "0" ]; then + # Generate the script to setup environment variables + MPA_DST_PATH=/opt/intel/sgx-ra-service -# Disable service -if [ -d /run/systemd/users ]; then - systemctl disable mpa_registration_tool.service -fi + # Disable service + if [ -d /run/systemd/users ]; then + systemctl disable mpa_registration_tool.service + fi -# Removing MPA configuration file -rm -f /etc/init/mpa_registration_tool.conf -rm -f /lib/systemd/system/mpa_registration_tool.service -rm -f /usr/lib/systemd/system/mpa_registration_tool.service -rm -f /etc/systemd/system/mpa_registration_tool.service + # Removing MPA configuration file + rm -f /etc/init/mpa_registration_tool.conf + rm -f /lib/systemd/system/mpa_registration_tool.service + rm -f /usr/lib/systemd/system/mpa_registration_tool.service + rm -f /etc/systemd/system/mpa_registration_tool.service -# Removing MPA folder -rm -rf $MPA_DST_PATH + # Removing MPA folder + rm -rf $MPA_DST_PATH -#Removing log file -rm -f /var/log/mpa_registration.log + #Removing log file + rm -f /var/log/mpa_registration.log +fi echo -e "Uninstallation succeed!" @@ -845,17 +847,19 @@ echo -e "Uninstallation succeed!" if [ -x /opt/intel/sgx-aesm-service/cleanup.sh ]; then /opt/intel/sgx-aesm-service/cleanup.sh; fi %postun -n sgx-dcap-pccs -if which pm2 > /dev/null; then - pm2 stop pccs || true - pm2 delete pccs || true - pm2cfg=`/bin/su -c "pm2 unstartup | grep 'sudo'" - $(logname)` || true - eval $pm2cfg || true -fi +if [ "$1" = "0" ]; then + if which pm2 > /dev/null; then + pm2 stop pccs || true + pm2 delete pccs || true + pm2cfg=`/bin/su -c "pm2 unstartup | grep 'sudo'" - $(logname)` || true + eval $pm2cfg || true + fi -if [ -d /opt/intel/sgx-dcap-pccs ]; then - pushd /opt/intel/sgx-dcap-pccs &> /dev/null - rm -rf node_modules || true - popd &> /dev/null + if [ -d /opt/intel/sgx-dcap-pccs ]; then + pushd /opt/intel/sgx-dcap-pccs &> /dev/null + rm -rf node_modules || true + popd &> /dev/null + fi fi @@ -934,6 +938,9 @@ fi %files -n sgx-ra-service -f %{TOOLS_INSTALLER_RPM_DIR}/sgx-ra-service/build/list-sgx-ra-service %changelog +* Sat Sep 24 2022 wangyu - 2.11.100-12 +- The postun script should distinguish uninstall and upgrade scenarios + * Sat Sep 03 2022 fangxiuning - 2.11.100-11 - Fix CVE-2022-2068 CVE-2022-0778 CVE-2022-1292 CVE-2022-2097