libselinux: Ignore directories removed during relabeling
PATCH 1/1 libselinux: Ignore directories removed during relabeling
Extend 54c79a74f5b9154762abaadf8194665598b24115 to directories, since users will expect them to be ignored as well.
In case ignore_noent is specified, ignore directories removed during relabeling (race condition between directory read and removal after parent directory read).
--- libselinux/src/selinux_restorecon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
libselinux/src/selinux_restorecon.c +4 -3
@@ -932,9 +932,10 @@ loop_body:case FTS_DNR : error = errno; errno = ftsent->fts_errno; -selinux_log (SELINUX_ERROR , -"Could not read %s: %m.\n" , - ftsent->fts_path); +if (!state->flags.ignore_noent || errno !=ENOENT ) +selinux_log (SELINUX_ERROR , +"Could not read %s: %m.\n" , + ftsent->fts_path); errno = error;fts_set (fts, ftsent,FTS_SKIP );continue ;
Signature · 1 line
2.52.0
Quoted 3 lines · Vit Mojzis
Extend
54c79a74f5b9154762abaadf8194665598b24115to directories, since users will expect them to be ignored as well.
For future reference, please include the one-line summary of the commit along with the hash, and feel free to shorten the hash, ala:
commit 54c79a74f5b91547 ("libselinux: Ignore files removed during relabeling")
Quoted 6 lines
In case
ignore_noentis specified, ignore directories removed during relabeling (race condition between directory read and removal after parent directory read).Signed-off-by Vit Mojzis <[email protected]>
Quoted 26 lines
--- libselinux/src/selinux_restorecon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)libselinux/src/selinux_restorecon.c +4
-4@@ -932,9 +932,10 @@ loop_body:case FTS_DNR : error = errno; errno = ftsent->fts_errno; -selinux_log (SELINUX_ERROR , -"Could not read %s: %m.\n" , - ftsent->fts_path); +if (!state->flags.ignore_noent || errno !=ENOENT ) +selinux_log (SELINUX_ERROR , +"Could not read %s: %m.\n" , + ftsent->fts_path); errno = error;fts_set (fts, ftsent,FTS_SKIP );continue ; --2.52.0