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

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