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: POSIX compliance of unlink(2)


On Mon, Feb 28, 2005 at 10:45:59PM +0000, Eric Blake wrote:
>1.5.12 and the latest snapshots allow unlinking a file contrary to POSIX 
>rules.  The addition of CYGWIN=traverse was not enough to fix this issue.  
>Unlink is required to fail with EACCES if the file is contained in a directory 
>without write permission.
>
>$ mkdir a
>$ touch a/b
>$ chmod a-w a
>$ touch a/c    # Correctly fails
>touch: cannot touch `a/c': Permission denied
>$ rm a/b       # Oops, should have failed
>$ 
>
>Furthermore, unlink should touch the ctime of the containing directory, and the 
>ctime of the unlink'd file (if hard links remain after the unlink succeeds).  
>In general, open(O_CREAT), link, rename, mkdir, and rmdir should touch the 
>ctime of the containing directory when the directory's contents change.

I'm getting a little concerned that we're focusing on a corner case of
the POSIX implementation at the expense of speed.  The reality is that
the ctime setting in NTFS is not really the same thing as what is found
in UNIX and trying to make it be the same thing is going to slow down
cygwin.  And, it might even confuse native windows apps.

Unless there are actual user complaints about ctime handling, I don't think
it makes sense to pursue this any further.  OTOH, if someone wants to
implement a "CYGWIN=posixly_correct" environment option, that might be ok.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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