Blame selinux_transactional_update.patch

fda951
Index: rpm-4.17.1.1/plugins/selinux.c
fda951
===================================================================
fda951
--- rpm-4.17.1.1.orig/plugins/selinux.c
fda951
+++ rpm-4.17.1.1/plugins/selinux.c
fda951
@@ -7,6 +7,7 @@
fda951
 #include <rpm/rpmlog.h>
fda951
 #include <rpm/rpmts.h>
fda951
 #include "lib/rpmplugin.h"
fda951
+#include <stdlib.h>
fda951
 
fda951
 #include "debug.h"
fda951
 
fda951
@@ -165,9 +166,15 @@ static rpmRC selinux_fsm_file_prepare(rp
fda951
 	char *scon = NULL;
fda951
 	if (selabel_lookup_raw(sehandle, &scon, dest, file_mode) == 0) {
fda951
 	    int conrc = lsetfilecon(path, scon);
fda951
-
fda951
 	    if (conrc == 0 || (conrc < 0 && errno == EOPNOTSUPP))
fda951
 		rc = RPMRC_OK;
fda951
+	    else {
fda951
+		char *tup = getenv("TRANSACTIONAL_UPDATE");
fda951
+		if ( tup != NULL && ! strncmp( tup, "true", 4 ) ) {
fda951
+		    rpmlog(RPMLOG_DEBUG, "lsetfilecon failed, will be healed upon reboot (transactional update): (%s, %s)\n", path, scon);
fda951
+		    rc = RPMRC_OK;
fda951
+		}
fda951
+	    }
fda951
 
fda951
 	    rpmlog(loglvl(rc != RPMRC_OK), "lsetfilecon: (%s, %s) %s\n",
fda951
 		       path, scon, (conrc < 0 ? strerror(errno) : ""));