X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flabel.c;h=43f6e89fa5a1e22bdf30f39195c523ece3714f37;hp=218d0dfa06f119e34991f2bd4d281c163e5b9f9f;hb=38a285d776cc0bf4440efe79fc7691032bcf3d67;hpb=dce8e2e12304946a13c261b2324ce1e14ed9f5cd diff --git a/src/label.c b/src/label.c index 218d0dfa0..43f6e89fa 100644 --- a/src/label.c +++ b/src/label.c @@ -65,7 +65,7 @@ int label_init(void) { return r; } -int label_fix(const char *path) { +int label_fix(const char *path, bool ignore_enoent) { int r = 0; #ifdef HAVE_SELINUX @@ -94,6 +94,10 @@ int label_fix(const char *path) { } if (r < 0) { + /* Ignore ENOENT in some cases */ + if (ignore_enoent && errno == ENOENT) + 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;