Blame SOURCES/0003-postprocess-stronger-handling-for-sepolicy-in-var.patch

c034ea
From 943138b13254eae339afe47eeccfef5c5f01e2de Mon Sep 17 00:00:00 2001
c034ea
From: Jonathan Lebon <jlebon@redhat.com>
c034ea
Date: Thu, 15 Jun 2017 13:21:01 -0400
c034ea
Subject: [PATCH 3/4] postprocess: stronger handling for sepolicy in /var
c034ea
c034ea
We shouldn't just check that the "targeted" dir exists, but rather that
c034ea
the actual directory where the modules are stored exists. This fixes a
c034ea
regression on RHEL in which the new selinux-policy-targeted lists some
c034ea
%ghost files under /var/lib/selinux and as a result think that the
c034ea
policy is in /var.
c034ea
c034ea
Closes: #831
c034ea
Approved by: cgwalters
c034ea
---
c034ea
 src/libpriv/rpmostree-postprocess.c | 3 ++-
c034ea
 1 file changed, 2 insertions(+), 1 deletion(-)
c034ea
c034ea
diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c
c034ea
index 77ad66a..8252f41 100644
c034ea
--- a/src/libpriv/rpmostree-postprocess.c
c034ea
+++ b/src/libpriv/rpmostree-postprocess.c
c034ea
@@ -592,7 +592,8 @@ postprocess_selinux_policy_store_location (int rootfs_dfd,
c034ea
     return TRUE;
c034ea
 
c034ea
   var_policy_location = glnx_strjoina ("var/lib/selinux/", name);
c034ea
-  if (fstatat (rootfs_dfd, var_policy_location, &stbuf, 0) != 0)
c034ea
+  const char *modules_location = glnx_strjoina (var_policy_location, "/active/modules");
c034ea
+  if (fstatat (rootfs_dfd, modules_location, &stbuf, 0) != 0)
c034ea
     {
c034ea
       if (errno != ENOENT)
c034ea
         return glnx_throw_errno_prefix (error, "fstat(%s)", modules_location);
c034ea
-- 
c034ea
2.13.0
c034ea