[Bug 287451] [/bin/ls] readdir() errors delivered via fts_children() are silently discarded
Date: Sun, 12 Apr 2026 13:45:25 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287451
--- Comment #3 from commit-hook@FreeBSD.org ---
A commit in branch stable/14 references this bug:
URL:
https://cgit.FreeBSD.org/src/commit/?id=6c92918fa159e974322c5e09ac6cffa9d807b0f2
commit 6c92918fa159e974322c5e09ac6cffa9d807b0f2
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2026-02-11 19:55:55 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-04-12 13:43:45 +0000
ls: check fts_children() for errors that may not surface otherwise
In particular, if one simply does a non-recursive `ls` on a directory
that is not accessible, there are some classes of errors that may cause
it to fail that wouldn't be surfaced unless we do an fts_read() that
will recurse into the inaccessible directory. Catch those kinds of
errors here since we cannot expect to an FTS_ERR/FTS_DNR entry to follow
up on them.
PR: 287451
Reviewed by: kib
Discusssed with: des
(cherry picked from commit 7bf81e39d83087dc7f984077b5eed5a48df794d4)
bin/ls/ls.c | 17 +++++++++++++++++
bin/ls/tests/ls_tests.sh | 30 ++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+)
--
You are receiving this mail because:
You are on the CC list for the bug.