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

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