anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0337-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch

84b277
From 5e102f2c8212a94b3a5221b5cf79eaafef693cc7 Mon Sep 17 00:00:00 2001
84b277
From: Lennart Poettering <lennart@poettering.net>
84b277
Date: Mon, 24 Mar 2014 21:04:02 +0100
84b277
Subject: [PATCH] core: don't try to relabel mounts before we loaded the policy
84b277
84b277
(cherry-picked from c4bfd1691f4d3e26d6d7f34dbca941e119956e8a)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/core/mount-setup.c | 5 ++++-
84b277
 1 file changed, 4 insertions(+), 1 deletion(-)
84b277
84b277
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
84b277
index 679f289..cff83d3 100644
84b277
--- a/src/core/mount-setup.c
84b277
+++ b/src/core/mount-setup.c
84b277
@@ -166,7 +166,10 @@ static int mount_one(const MountPoint *p, bool relabel) {
84b277
 
84b277
         /* The access mode here doesn't really matter too much, since
84b277
          * the mounted file system will take precedence anyway. */
84b277
-        mkdir_p_label(p->where, 0755);
84b277
+        if (relabel)
84b277
+                mkdir_p_label(p->where, 0755);
84b277
+        else
84b277
+                mkdir_p(p->where, 0755);
84b277
 
84b277
         log_debug("Mounting %s to %s of type %s with options %s.",
84b277
                   p->what,