summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-03 16:25:50 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-03 16:25:50 +0200
commitc9bc07646100855ff8193e1e62c52b77327e264d (patch)
tree41a37615bb323ff5c6a5a212209ae12e6ec1b054 /src/shared
parent61b1477c8107e9b7143be9acf6bf678fa9d0674d (diff)
mount-setup: don't complain if we try to fix the label of a dir beneath a mount but can't due to EROFS
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/label.c5
-rw-r--r--src/shared/label.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/shared/label.c b/src/shared/label.c
index 9a5f79d7ae..7aa362106e 100644
--- a/src/shared/label.c
+++ b/src/shared/label.c
@@ -99,7 +99,7 @@ int label_init(const char *prefix) {
return r;
}
-int label_fix(const char *path, bool ignore_enoent) {
+int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
int r = 0;
#ifdef HAVE_SELINUX
@@ -132,6 +132,9 @@ int label_fix(const char *path, bool ignore_enoent) {
if (ignore_enoent && errno == ENOENT)
return 0;
+ if (ignore_erofs && errno == EROFS)
+ return 0;
+
log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG,
"Unable to fix label of %s: %m", path);
r = security_getenforce() == 1 ? -errno : 0;
diff --git a/src/shared/label.h b/src/shared/label.h
index 4f404b2f20..8d832f9a59 100644
--- a/src/shared/label.h
+++ b/src/shared/label.h
@@ -29,7 +29,7 @@
int label_init(const char *prefix);
void label_finish(void);
-int label_fix(const char *path, bool ignore_enoent);
+int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
int label_socket_set(const char *label);
void label_socket_clear(void);