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

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