From 68ebd4f452f4fe8f290eef6674cdd4687104abe3 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Thu, 7 Aug 2014 09:08:12 -0400 Subject: [PATCH 5/5] If the user attempts to restorecon the label of a file that does not exist, do not report this as an error --- policycoreutils/setfiles/restore.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/policycoreutils/setfiles/restore.c b/policycoreutils/setfiles/restore.c index 2a7cfa3..10933e4 100644 --- a/policycoreutils/setfiles/restore.c +++ b/policycoreutils/setfiles/restore.c @@ -160,6 +160,9 @@ static int restore(FTSENT *ftsent, int recurse) /* Get the current context of the file. */ ret = lgetfilecon_raw(ftsent->fts_accpath, &curcon); if (ret < 0) { + if (errno == ENOENT) { + goto out; + } if (errno == ENODATA) { curcon = NULL; } else { -- 2.1.0