Blame SOURCES/0003-do-not-rm-selinux-rpm-owned-directory.patch

058681
kpatch: do not rm selinux rpm owned directory
058681
058681
As part of the kpatch rpm package installation, the /var/lib/kpatch directory
058681
gets created and is set to be selinux owned by the kpatch rpm package.
058681
058681
There is a problem where uninstalling the last kpatch-patch will also remove
058681
this directory. When another kpatch-patch installation occurs, the
058681
/var/lib/kpatch get recreated but withtout the selinux context which triggers a
058681
policy error.
058681
058681
Since /var/lib/kpatch is now created by the rpm spec file, do not remove it
058681
from the uinstall target of the kpatch script. This insures selinux context
058681
consistency.
058681
058681
RHEL-only.
058681
058681
Signed-off-by: Yannick Cote <ycote@redhat.com>
058681
diff -Nupr kpatch-0.9.4.old/kpatch/kpatch kpatch-0.9.4/kpatch/kpatch
058681
--- kpatch-0.9.4.old/kpatch/kpatch	2021-08-26 15:31:07.000000000 -0400
058681
+++ kpatch-0.9.4/kpatch/kpatch	2022-06-10 12:19:55.791538218 -0400
058681
@@ -584,7 +584,6 @@ case "$1" in
058681
 	echo "uninstalling $PATCH ($KVER)"
058681
 	rm -f "$MODULE" || die "failed to uninstall module $PATCH"
058681
 	rmdir --ignore-fail-on-non-empty "$INSTALLDIR/$KVER" || die "failed to remove directory $INSTALLDIR/$KVER"
058681
-	rmdir --ignore-fail-on-non-empty "$INSTALLDIR" || die "failed to remove directory $INSTALLDIR"
058681
 
058681
 	;;
058681