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 Feb 28 22:45, 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.

I've just tested this situation on XP SP2 and it turns out that when
deleting a file, no traverse checking seems to be performed. 

The DeleteFile function even succeeds if the parent folder's ACL
explicitely denies the permission to delete subfolders and files
for owner, group and everyone.

> 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.

If we also touch ctime on the parent directory in all these cases, that
will slow down Cygwin enourmously.  Each of these actions would require
to open the parent dir, set ctime, close parent dir.  That sounds like
a rather bad deal.


Corinna

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

--
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]