summaryrefslogtreecommitdiff
path: root/src/label.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-18 22:47:57 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-18 22:47:57 +0200
commit5a33f657b52f30a77fac41feb8854b563d77382e (patch)
tree6a04887c62a96888274e95fbff898b5c6fbdde52 /src/label.c
parente472d47628ec07b316ccd981a1ca359d1195946f (diff)
label: if the selinux policy knows no label, then silently don't do anything
Diffstat (limited to 'src/label.c')
-rw-r--r--src/label.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/label.c b/src/label.c
index 8b807847fd..fb570c54a5 100644
--- a/src/label.c
+++ b/src/label.c
@@ -76,11 +76,16 @@ int label_fix(const char *path) {
if (r == 0) {
r = selabel_lookup_raw(label_hnd, &fcon, path, st.st_mode);
+ /* If there's no label to set, then exit without warning */
+ if (r < 0 && errno == ENOENT)
+ return 0;
+
if (r == 0) {
r = setfilecon(path, fcon);
freecon(fcon);
}
}
+
if (r < 0) {
log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG,
"Unable to fix label of %s: %m", path);