This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Permission to read anything from ls, cp, and find?

Hash: SHA1

According to Corinna Vinschen on 10/16/2006 7:14 AM:
> Please be aware that one problem remains.  The Windows function
> SetCurrentDirectory, which is the base function used by chdir(2),
> apparently tries to open the directory in which to change without using
> the FILE_OPEN_FOR_BACKUP_INTENT flag.  This has the effect that chdir
> fails when the process has no sufficient permissions on the directory
> even if it has backup privileges.  This is also very unfortunate, since,
> for instance, find(1) traverses directory trees by chdir'ing into
> directories before listing them.  So even with this patch, find(1) is
> still not a good candidate for backing up directory trees in a situation
> as you describe above.  tar(1) doesn't seem to have this problem,
> though.

Which version of find?  find 4.3.0 switched over to gnulib's fts
implementation, which, if openat() and friends were to be implemented, is
capable of traversing directories without using chdir.  Even with the
current cygwin limitation of no openat(), it can still traverse almost
everything using /proc/self/fd/blah; the only problem is that because
cygwin still incorrectly treats /proc/self/fd/.. as /proc/self/ instead of
the parent directory of the open directory fd, you can't traverse back up
the tree.

- --
Life is short - so eat dessert first!

Eric Blake   
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]