!65 The postun script should distinguish uninstall and upgrade scenarios

From: @BornThisWay 
Reviewed-by: @houmingyong 
Signed-off-by: @houmingyong
This commit is contained in:
openeuler-ci-bot 2022-09-24 06:39:24 +00:00 committed by Gitee
commit fe7117c65e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,6 +1,6 @@
Name: linux-sgx Name: linux-sgx
Version: 2.11.100 Version: 2.11.100
Release: 11 Release: 12
Summary: Intel(R) Software Guard Extensions for Linux* OS Summary: Intel(R) Software Guard Extensions for Linux* OS
ExclusiveArch: x86_64 ExclusiveArch: x86_64
License: BSD-3-Clause License: BSD-3-Clause
@ -811,6 +811,7 @@ echo -e "Installation succeed!"
systemctl start mpa_registration_tool.service systemctl start mpa_registration_tool.service
%postun -n sgx-ra-service %postun -n sgx-ra-service
if [ "$1" = "0" ]; then
# Generate the script to setup environment variables # Generate the script to setup environment variables
MPA_DST_PATH=/opt/intel/sgx-ra-service MPA_DST_PATH=/opt/intel/sgx-ra-service
@ -830,6 +831,7 @@ rm -rf $MPA_DST_PATH
#Removing log file #Removing log file
rm -f /var/log/mpa_registration.log rm -f /var/log/mpa_registration.log
fi
echo -e "Uninstallation succeed!" echo -e "Uninstallation succeed!"
@ -845,6 +847,7 @@ echo -e "Uninstallation succeed!"
if [ -x /opt/intel/sgx-aesm-service/cleanup.sh ]; then /opt/intel/sgx-aesm-service/cleanup.sh; fi if [ -x /opt/intel/sgx-aesm-service/cleanup.sh ]; then /opt/intel/sgx-aesm-service/cleanup.sh; fi
%postun -n sgx-dcap-pccs %postun -n sgx-dcap-pccs
if [ "$1" = "0" ]; then
if which pm2 > /dev/null; then if which pm2 > /dev/null; then
pm2 stop pccs || true pm2 stop pccs || true
pm2 delete pccs || true pm2 delete pccs || true
@ -857,6 +860,7 @@ if [ -d /opt/intel/sgx-dcap-pccs ]; then
rm -rf node_modules || true rm -rf node_modules || true
popd &> /dev/null popd &> /dev/null
fi fi
fi
%files -n sgxsdk -f %{LINUX_INSTALLER_RPM_DIR}/sdk/build/list-sgxsdk %files -n sgxsdk -f %{LINUX_INSTALLER_RPM_DIR}/sdk/build/list-sgxsdk
@ -934,6 +938,9 @@ fi
%files -n sgx-ra-service -f %{TOOLS_INSTALLER_RPM_DIR}/sgx-ra-service/build/list-sgx-ra-service %files -n sgx-ra-service -f %{TOOLS_INSTALLER_RPM_DIR}/sgx-ra-service/build/list-sgx-ra-service
%changelog %changelog
* Sat Sep 24 2022 wangyu <wangyu283@huawei.com> - 2.11.100-12
- The postun script should distinguish uninstall and upgrade scenarios
* Sat Sep 03 2022 fangxiuning <fangxiuning@huawei.com> - 2.11.100-11 * Sat Sep 03 2022 fangxiuning <fangxiuning@huawei.com> - 2.11.100-11
- Fix CVE-2022-2068 CVE-2022-0778 CVE-2022-1292 CVE-2022-2097 - Fix CVE-2022-2068 CVE-2022-0778 CVE-2022-1292 CVE-2022-2097