|
Zbigniew Jędrzejewski-Szmek |
f1004d |
From 0fff82e5f867f9494ed631736964d9abfe672673 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
From: Emil Renner Berthing <systemd@esmil.dk>
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
Date: Thu, 18 Sep 2014 15:24:55 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
Subject: [PATCH] mount-setup: skip relabelling when SELinux and SMACK not
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
supported
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
This is also the only place where FTW_ACTIONRETVAL is used, so
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
this makes systemd compile without SELinux or SMACK support
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
when the standard library doesn't support this extension.
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
---
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
src/core/mount-setup.c | 4 ++++
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
1 file changed, 4 insertions(+)
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
index 23a66d2e95..8e91217828 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
--- a/src/core/mount-setup.c
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
+++ b/src/core/mount-setup.c
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
@@ -351,6 +351,7 @@ int mount_cgroup_controllers(char ***join_controllers) {
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
+#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
static int nftw_cb(
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
const char *fpath,
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
const struct stat *sb,
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
@@ -372,6 +373,7 @@ static int nftw_cb(
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
return FTW_CONTINUE;
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
};
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
+#endif
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
int mount_setup(bool loaded_policy) {
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
int r;
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
@@ -384,6 +386,7 @@ int mount_setup(bool loaded_policy) {
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
+#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
/* Nodes in devtmpfs and /run need to be manually updated for
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
* the appropriate labels, after mounting. The other virtual
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
* API file systems like /sys and /proc do not need that, they
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
@@ -402,6 +405,7 @@ int mount_setup(bool loaded_policy) {
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
log_info("Relabelled /dev and /run in %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
format_timespan(timespan, sizeof(timespan), after_relabel - before_relabel, 0));
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
}
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
+#endif
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
/* Create a few default symlinks, which are normally created
|
|
Zbigniew Jędrzejewski-Szmek |
f1004d |
* by udevd, but some scripts might need them before we start
|