NetBSD Problem Report #12902

Received: (qmail 8955 invoked from network); 10 May 2001 21:29:01 -0000
Message-Id: <>
Date: Thu, 10 May 2001 14:30:01 -0700 (PDT)
Subject: find(1) gives spurious "No such file or directory" errors when fdesc present
X-Send-Pr-Version: www-1.0

>Number:         12902
>Category:       bin
>Synopsis:       find(1) gives spurious "No such file or directory" errors when fdesc present
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 10 21:30:00 +0000 2001
>Last-Modified:  Thu Mar 25 00:30:54 +0000 2004
>Originator:     Anne Bennett
>Release:        1.5
Concordia University
NetBSD 1.5 NetBSD 1.5 (ERIDANI) #1: Tue Mar 20 15:48:34 EST 2001 i386

Under some circumstances, the "find" command reports "No such file
or directory" for directories which do exist.  While I can't find
a pattern to why some directories are thus misreported while most
are not, I can say that (1) the behaviour is consistent, in that I
always see the *same* list of directories reported, (2) the behaviour
does not seem to depend on the amount of data processed, in that in
my tests, I saw the same errors even when I pruned out most of the
directories being searched, (3) the problem is related to trying to
process an fdesc filesystem -- it is after the fdesc filesystem is
traversed, and an error reported for /dev/fd/4, that the other errors
are reported.  If I prune out /dev, or if I prune "fstype fdesc", the
problem goes away.  Perhaps some error condition is not being
cleared properly?
I found the problem while installing COPS (yes, I know that NetBSD
1.5 now has its own setuid file checker), so here's the code snippet
that causes the problem on my system:



/usr/bin/find / \
   \(        \( -path /usr -prune         \)    \
          -o \( -path /big -prune         \) \) -o \
  -type f \( -perm -4000 -o -perm -2000 \) \
  -exec /bin/ls -ldag {} \; 2> $TEMPERR > $TEMPCUR


Make sure you test on a system which uses the fdesc filesystem, i.e.
with this in fstab:

  /dev      /dev    fdesc   ro,union  0 0

To show that the problem is removed when the fdesc files are not
traversed, add one of these to the "find" statement above:

  -fstype fdesc -a -prune -o
  -path /usr -prune

Not known, sorry.  :-(


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.