All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selinux_restorecon: Do not exit on directory cycles
@ 2026-07-21  7:17 Johannes Segitz
  2026-07-21 13:54 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Segitz @ 2026-07-21  7:17 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

All other failures are handled gracefully. Directory cycles can e.g.
happen on BTRFS filesystems with subvolumes. Skip them and continue
instead of exiting

Signed-off-by: Johannes Segitz <jsegitz@suse.de>
---
 libselinux/src/selinux_restorecon.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
index 7ef2d45d..33d315a2 100644
--- a/libselinux/src/selinux_restorecon.c
+++ b/libselinux/src/selinux_restorecon.c
@@ -883,13 +883,12 @@ loop_body:

                switch (ftsent->fts_info) {
                case FTS_DC:
-                       selinux_log(SELINUX_ERROR,
+                       selinux_log(SELINUX_WARNING,
                                    "Directory cycle on %s.\n",
                                    ftsent->fts_path);
                        errno = ELOOP;
-                       state->error = -1;
-                       state->abort = true;
-                       goto finish;
+                       fts_set(fts, ftsent, FTS_SKIP);
+                       continue;
                case FTS_DP:
                        continue;
                case FTS_DNR:
--
2.55.0

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 870 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-21 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21  7:17 [PATCH] selinux_restorecon: Do not exit on directory cycles Johannes Segitz
2026-07-21 13:54 ` Stephen Smalley
2026-07-21 15:15   ` Johannes Segitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.