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

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