X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flabel.c;h=809b1ee64656fb5a75c590a73ee16c44551f28b5;hp=8b807847fd883db4d1cba9dce41d9c0c6850c006;hb=5b40d54851da5934a0c819b35d6d5338039ee923;hpb=049f86421bfe8afcbb00c7ee5a76fd14841f8bbf diff --git a/src/label.c b/src/label.c index 8b807847f..809b1ee64 100644 --- a/src/label.c +++ b/src/label.c @@ -76,11 +76,20 @@ 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 the FS doesn't support labels, then exit without warning */ + if (r < 0 && errno == ENOTSUP) + return 0; } } + if (r < 0) { log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG, "Unable to fix label of %s: %m", path);