!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
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,26 +811,28 @@ 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
# 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 folder
rm -rf $MPA_DST_PATH
#Removing log file
rm -f /var/log/mpa_registration.log
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 folder
rm -rf $MPA_DST_PATH
#Removing log file
rm -f /var/log/mpa_registration.log
echo -e "Uninstallation succeed!"
%postun -n sgx-pck-id-retrieval-tool
@ -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 <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
- Fix CVE-2022-2068 CVE-2022-0778 CVE-2022-1292 CVE-2022-2097