This is the mail archive of the cygwin-developers@cygwin.com 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]

Re: readonly, NTFS, and file metadata


On Mon, Aug 13, 2001 at 04:54:06PM -0400, Charles Wilson wrote:
> There is an ongoing thread on the automake list (started by yours truly,
> agent provocateur) concerning some strangeness I've encountered on
> NTFS(ntsec), with 'cp -p' and readonly files.  The URL for the beginning
> [...]
> What happens is this: first, foo is copied to bar, with perms
> -r--r--r--.  But, the timestamp is wrong.  Since cp was called with
> '-p', cp then tries to set the timestamp of bar to match foo.  But it
> can't on cygwin.  On linux, it can.
> 
> My suggestion to the automake list, which was to make foo be -rw-r--r--,
> was not well received.  The suggestion in return was: make cygwin act
> like linux.  I can't really argue against that, since that's been our
> stated goal anyway.
> 
> Does anybody know offhand what it would take to 'linux-ize' this
> behavior (e.g. would we have to take a performance hit?)  Do we want to
> be like linux in this particular? Also, please check the thread
> referenced above.

Check return code of SetFileTime(), check if ntsec ON and
file is on NTFS, get current ACL, modify to have write_data
access for current user, call SetFileTime() again, reset ACL.

The only problem is that we need a new function set which
_exactly_ saves and restores a given ACL and another function
which exactly adds write access to the current user. The
standard functions in security.cc are not appropriate.

I wouldn't think it's a big deal in terms of performance.
And if I have to choose between speed and correctness I
tend to vote for correctness.

OTOH, I don't have that much time currently,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


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