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

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