From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30821 invoked by alias); 6 Apr 2011 23:35:04 -0000 Received: (qmail 30508 invoked by uid 22791); 6 Apr 2011 23:35:03 -0000 X-SWARE-Spam-Status: No, hits=0.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from radlog1.lnk.telstra.net (HELO midge.radlogic.com.au) (165.228.189.75) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Apr 2011 23:34:52 +0000 Received: from groper.radnet.com.au (groper.radnet.com.au [10.1.1.1]) by midge.radlogic.com.au (8.13.1/8.13.1) with ESMTP id p36NYnBu003802 for ; Thu, 7 Apr 2011 09:04:49 +0930 Received: from gar (gar.radnet.com.au [10.1.1.77]) by groper.radnet.com.au (8.13.1/8.13.1) with ESMTP id p36NYj68002679 for ; Thu, 7 Apr 2011 09:04:49 +0930 From: "Christian Gelinek" To: References: <000001cbf3f2$843bd520$8cb37f60$@com.au> <4D9BC305.9030201@cygwin.com> In-Reply-To: <4D9BC305.9030201@cygwin.com> Subject: RE: NTFS write-protect flag translation (tar? rsync?) only one-way? Date: Thu, 07 Apr 2011 06:01:00 -0000 Message-ID: <000401cbf4b3$2d0819a0$87184ce0$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-04/txt/msg00095.txt.bz2 -----Original Message----- From: Cygwin On Behalf Of Larry Hall (Cygwin) Sent: Wednesday, 6 April 2011 11:04 AM Subject: Re: NTFS write-protect flag translation (tar? rsync?) only one-way? >On 4/5/2011 8:35 PM, Christian Gelinek wrote: >> From: Cygwin On Behalf Of Larry Hall (Cygwin) >>> On 4/5/2011 3:36 AM, Christian Gelinek wrote: >>>> It appears that when tar reads files for adding to archives, it >>>> correctly interprets the Windows-set "R" attribute, which is also seen= by >>>> ls under Cygwin. After extracting the files using tar though, only >>>> Cygwin's ls command seems to be aware of the read-only attribute; the >>>> attrib command (as well as Explorer and other Windows-apps) see and >>>> handle the file as being writeable. >>> >>> The read-only attribute is a "Windows" thing. Cygwin's utilities focus= on >>> supporting POSIXy/Linuxy ways of doing things. You can't expect Cygwin= 's >>> tools to manage all of Window's permission facilities in the same way as >>> Windows does. The read-only flag is one case where you'll see a diverg= ence. >>> If you need that flag set, you'll need your own wrapper to set it based= on >>> the POSIX (or ACL) permissions. The read-only attribute really is quite >>> anachronistic though IMO. It conflicts with the more powerful ACLs. If >>> you have the option, it's better not to use that flag. >> >> IMO the behaviour is inconsistent if the flag is used/interpreted on one= (the >> read) operation but NOT being written/changed on the other (write) opera= tion. >> My approach would be either drop it completely or support it on both ends >> (the preferred option). > >Actually, the read-only attribute is not used by Cygwin to determine POSIX >permissions. According to what I have seen, the command=20 attrib +R wp.txt changes ONLY the read-only flag - when I look at the Security page of the f= ile properties dialog in Windows Explorer, the ACLs are not modified by att= rib. Still Cygwin would see the file as read-only after the attrib call (pl= ease see my original post for the complete sequence of commands). >> By the looks of it (see >> http://sourceware.org/ml/cygwin/2002-05/msg00317.html), this problem has >> been addressed and potentially solved before, so I wonder if something is >> broken here. > >No, nothing is broken. Things have changed since 2002. If you want the g= ory >details, you can look in the email archives. The short of it is, making >read-only, Windows ACLs, and POSIX permissions all agree is overly >complicated. So we've dropped read-only support now. But AFAIK (see above) only for write operations. I also agree that there is a complicating overlap between the read-only att= ribute and the ACLs. Nevertheless, most Windows programs honour the read-on= ly flag and Explorer can display a column listing such attributes as oppose= d to effective ACL permissions.=20 The Samba server struggles with similar problems, as it also has to transla= te between POSIX and Windows permissions. Samba's solution is to emulate AC= Ls AND the read-only flag. It would be interesting how Samba treats changes= to the read-only flag done by Windows, how it translates them to Linux per= missions and back to Windows (does it change ACLs as well?). When I've got = some time, I'll look into this. >> The background to all this is that I am using RCS (I know, almost as >> anachronistic as the read-only attribute, but that's dictated by my >> workplace) under both Windows and Linux and RCS relies heavily on the >> read-only attribute of files to be correct. IMO, it wouldn't hurt if the >> Cygwin tools would write the Windows read-only attribute when they creat= e a >> Cygwin read-only file? > >Cygwin has a package for RCS. Perhaps that could solve your problem? Thanks for pointing that out, I will have a look at that as well. Regards, Christian -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple