mirror of
git://git.sv.gnu.org/findutils.git
synced 2026-01-30 13:18:59 +01:00
find: process unreadable directories with -depth
* find/ftsfind.c (consider_visiting): Split the FTS_ERR and FTS_DNR cases to be able to continue processing that entry in the latter case (unreadable directory) when the -depth option is given. * NEWS (Bug Fixes): Mention the fix. Reported by Tavian Barnes in https://savannah.gnu.org/bugs/?54171.
This commit is contained in:
4
NEWS
4
NEWS
@@ -54,6 +54,10 @@ Some minor documentation improvements are listed in "Bug Fixes" below.
|
||||
|
||||
** Bug Fixes
|
||||
|
||||
#54171: 'find -depth' now outputs the name of unreadable directories.
|
||||
Previously, FTS-based find missed to output those entries.
|
||||
Bug present since the FTS implementation in FINDUTILS_4_3_0-1.
|
||||
|
||||
#52981: find: the '-delete' action no longer complains about disappeared files
|
||||
when the '-ignore_readdir_race' option is given, too. That action will
|
||||
also returns true in such a case now.
|
||||
|
||||
@@ -342,12 +342,23 @@ consider_visiting (FTS *p, FTSENT *ent)
|
||||
statbuf.st_ino = ent->fts_statp->st_ino;
|
||||
|
||||
/* Cope with various error conditions. */
|
||||
if (ent->fts_info == FTS_ERR
|
||||
|| ent->fts_info == FTS_DNR)
|
||||
if (ent->fts_info == FTS_ERR)
|
||||
{
|
||||
nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
|
||||
return;
|
||||
}
|
||||
if (ent->fts_info == FTS_DNR)
|
||||
{
|
||||
nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
|
||||
if (options.do_dir_first)
|
||||
{
|
||||
/* Return for unreadable directories without -depth.
|
||||
* With -depth, the directory itself has to be processed, yet the
|
||||
* error message above has to be output.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (ent->fts_info == FTS_DC)
|
||||
{
|
||||
issue_loop_warning (ent);
|
||||
|
||||
Reference in New Issue
Block a user