Skip to content

Commit 7ab040d

Browse files
committed
chcon: walk directories with DirFd instead of fts
Reuse uucore::safe_traversal, the same traversal chown and chgrp already use, in place of fts(3). Directories are still labelled post-order, so a context that forbids reading one is applied only once its contents are done. Cycles are now caught with a set of the directories open on the current path rather than FTS_DC, and the stale-stat retry goes away: entries are stat'ed when they are visited rather than when the walk is opened. chcon was the only fts-sys user in the workspace, so the dependency goes with it.
1 parent 1d3ee39 commit 7ab040d

4 files changed

Lines changed: 178 additions & 489 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/chcon/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ uucore = { workspace = true, features = ["entries", "fs", "perms"] }
2323
selinux = { workspace = true }
2424
thiserror = { workspace = true }
2525
libc = { workspace = true }
26-
fts-sys = { workspace = true }
2726
rustix = { workspace = true, features = ["fs"] }
2827
fluent = { workspace = true }
2928

0 commit comments

Comments
 (0)