delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/18/04:44:50

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 18 Apr 2011 10:43:57 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: NTFS write-protect flag translation (tar? rsync?) only one-way?
Message-ID: <20110418084357.GB25815@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <000001cbf3f2$843bd520$8cb37f60$@com.au> <4D9BC305 DOT 9030201 AT cygwin DOT com>
MIME-Version: 1.0
In-Reply-To: <4D9BC305.9030201@cygwin.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Apr  5 21:33, Larry Hall (Cygwin) wrote:
> 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 divergence.
> >>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) operation.
> >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.

Actually if it is set it is used to remove the write bits from the
permission bits in calls to stat.  However, since the DOS attributes
are only in the way in terms of POSIX permissions, it's never set
in calls to chmod.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019