Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!rutgers!att!watmath!mks.com!femto!eric From: eric@femto.mks.com (Eric Gisin) Newsgroups: comp.unix.i386 Subject: Re: find: stat() failed: /usr/adm - no such file or directory Message-ID: Date: 20 Aug 90 11:28:24 GMT References: <1990Aug09.232824.10717@scuzzy.mbx.sub.org> Sender: eric@mks.com (Eric Gisin) Distribution: comp Organization: Mortice Kern Systems Inc., Waterloo, Ontario, CANADA Lines: 31 In-Reply-To: src@scuzzy.mbx.sub.org's message of 9 Aug 90 23:28:24 GMT In article <1990Aug09.232824.10717@scuzzy.mbx.sub.org> src@scuzzy.mbx.sub.org (Heiko Blume) writes: well, i have this *really* *very* *weird* problem with ISC 2.2: when i do a 'find /usr -name bla' as *root* i get find: stat() failed: /usr/admin/cops/user.chk: No such file or directory find: stat() failed: /usr/admin/dead.letter: No such file or directory find: stat() failed: /usr/mail: No such file or directory [.......] find: stat() failed: /usr/guest: No such file or directory find: stat() failed: /usr/chris: No such file or directory for all directories in /usr, but *not* for all *files* below /usr. in fact the first two *files* (as opposed to directories) are the only files find doesn't like. This is due to a bug in find combined with a corrupt directory. /usr/admin/cops or some subdirectory has an incorrect .. link. Unfortunatly fsck does not fix this or even give a warning (another bug). The way to find such problems is to cd to the suspect directories (/usr/admin and /usr/admin/cops) and do an "ls -id . */..". All the i-numbers should be the same. When you find a bad directory, use /etc/unlink to remove ".." and "/etc/link .. " to recreate "..". The bug in find is that it uses chdir(dir) and chdir("..") to move up and down the directory tree. If the .. link is incorrect, find gets confused. This also causes problems over NFS file systems that support sym links. Most likely /usr/admin/cops is only readable by root, so this only happens as root.