From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9623 invoked by alias); 5 Apr 2011 07:37:10 -0000 Received: (qmail 9490 invoked by uid 22791); 5 Apr 2011 07:37:08 -0000 X-SWARE-Spam-Status: No, hits=1.9 required=5.0 tests=AWL,BAYES_50,TW_PX 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; Tue, 05 Apr 2011 07:36:32 +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 p357aSU1031409 for ; Tue, 5 Apr 2011 17:06:29 +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 p357aPjG029516 for ; Tue, 5 Apr 2011 17:06:28 +0930 From: "Christian Gelinek" To: Subject: NTFS write-protect flag translation (tar? rsync?) only one-way? Date: Tue, 05 Apr 2011 13:04:00 -0000 Message-ID: <003c01cbf364$23257e50$69707af0$@com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit x-cr-hashedpuzzle: CPcP CyjP EvEE E4X2 FLm1 FRkY FXWU Gh1e Gxjw HMXr H2Vw IXov JOLA JkNF KPh+ LgqS;1;YwB5AGcAdwBpAG4AQABjAHkAZwB3AGkAbgAuAGMAbwBtAA==;Sosha1_v1;7;{AA95D1FE-483A-4518-902E-E50E763F6208};YwBnAGUAbABpAG4AZQBrAEAAcgBhAGQAbABvAGcAaQBjAC4AYwBvAG0ALgBhAHUA;Tue, 05 Apr 2011 07:36:09 GMT;TgBUAEYAUwAgAHcAcgBpAHQAZQAtAHAAcgBvAHQAZQBjAHQAIABmAGwAYQBnACAAdAByAGEAbgBzAGwAYQB0AGkAbwBuACAAKAB0AGEAcgA/ACAAcgBzAHkAbgBjAD8AKQAgAG8AbgBsAHkAIABvAG4AZQAtAHcAYQB5AD8A x-cr-puzzleid: {AA95D1FE-483A-4518-902E-E50E763F6208} 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/msg00071.txt.bz2 Hi everyone, I have a problem with the tar command with the "extract permissions information" option being set. I am running Cygwin (CYGWIN_NT-6.1-WOW64 1.7.8(0.236/5/3) 2011-03-01 09:36) under Windows 7 (Windows 7 Professional N Ver 6.1 Build 7600) with NTFS and the CYGWIN=ntsec environment variable. 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. There are some rather old posts in the archives stating the same (or similar) problems, but I couldn't find anything suggesting that there is anything wrong with my setup: http://sourceware.org/ml/cygwin/2002-05/msg00317.html I think this problem also applies to the rsync command, but I haven't tested it to that extent. Please see the following sequence of commands, partly in a Cygwin shell, partly in a Windows CMD shell: === Cygwin === cgelinek@gar ~/permission-test $ echo "I'll be write-protected" > wp.txt cgelinek@gar ~/permission-test $ echo "I'll be writable" > rw.txt cgelinek@gar ~/permission-test $ ls -l total 2 -rw-r--r-- 1 cgelinek None 17 Apr 5 16:36 rw.txt -rw-r--r-- 1 cgelinek None 24 Apr 5 16:35 wp.txt === CMD === C:\cygwin\home\cgelinek\permission-test>attrib A C:\cygwin\home\cgelinek\permission-test\rw.txt A C:\cygwin\home\cgelinek\permission-test\wp.txt C:\cygwin\home\cgelinek\permission-test>attrib +R wp.txt C:\cygwin\home\cgelinek\permission-test>attrib A C:\cygwin\home\cgelinek\permission-test\rw.txt A R C:\cygwin\home\cgelinek\permission-test\wp.txt === Cygwin === cgelinek@gar ~/permission-test $ ls -l total 2 -rw-r--r-- 1 cgelinek None 17 Apr 5 16:36 rw.txt -r--r--r-- 1 cgelinek None 24 Apr 5 16:35 wp.txt cgelinek@gar ~/permission-test $ tar -pcf files.tar rw.txt wp.txt cgelinek@gar ~/permission-test $ tar -pxf files.tar cgelinek@gar ~/permission-test $ ls -l total 14 -rw-r--r-- 1 cgelinek None 10240 Apr 5 16:39 files.tar -rw-r--r-- 1 cgelinek None 17 Apr 5 16:36 rw.txt -r--r--r-- 1 cgelinek None 24 Apr 5 16:35 wp.txt === CMD === C:\cygwin\home\cgelinek\permission-test>attrib A C:\cygwin\home\cgelinek\permission-test\files.tar A C:\cygwin\home\cgelinek\permission-test\rw.txt A C:\cygwin\home\cgelinek\permission-test\wp.txt Any suggestions or pointers on how to solve this would be appreciated. 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