Follow-up Comment #3, bugs #12044 (project findutils):

The current situation of having find hang when any remote

NFS server is unreachable is unacceptable, since it makes

my carefully engineered scripts fail due to the whims of

a flaky network.  I carefully prune PATH, for example,

to have as few dependencies on NFS servers as possible.

Stating the roots of all remote filesystem is even an 

invitation to a denial-of-service attack.



It is also unacceptable to erroneously follow symlinks,

since this could lead to unexpected manipulation of

arbitrary files.



What to do?  I still think we can have a robust find.



To chdir() to a subdir, you

- stat("."); save dot_fd;

- st = lstat(file); if ISDIR {

  chdir(file);

  check stat(".") matches st inode and filesystem.

  if not, fchdir(dot_fd) and retry.



Keep track of retry count.  Retry at least once, but perhaps

only once.



Another robust approach is to stat("..") after chdir,

and compare with stat(".") before chdir.



Another comment -- O_NOFOLLOW is very fragile, since

a version check is used, which must be updated on a 

regular (yearly?) basis.  I think it might be too early

to use O_NOFOLLOW in production software.

    _______________________________________________________

This item URL is:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12044>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils

Reply via email to