From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10082 invoked by alias); 31 Dec 2008 23:32:26 -0000 Received: (qmail 10070 invoked by uid 22791); 31 Dec 2008 23:32:26 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from vms042pub.verizon.net (HELO vms042pub.verizon.net) (206.46.252.42) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 31 Dec 2008 23:31:46 +0000 Received: from [127.0.0.1] ([71.112.11.46]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KCR00M7ILCVR964@vms042.mailsrvcs.net> for cygwin@cygwin.com; Wed, 31 Dec 2008 17:31:45 -0600 (CST) Date: Wed, 31 Dec 2008 23:32:00 -0000 From: David Rothenberger Subject: [BUG 1.7] Read-only files are not. To: cygwin Message-id: <495C00DF.5020208@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666 X-IsSubscribed: yes Reply-To: cygwin@cygwin.com 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: 2008-12/txt/msg00732.txt.bz2 It seems that read-only files in Cygwin 1.7 are not truly read-only. The sequence of steps below shows that "chmod 444 file1" does not make the file read-only in Cygwin 1.7, while it does in Cygwin 1.5. It may have something to do with the Read Only DOS attribute. This is set by Cygwin 1.5 but not by Cygwin 1.7. If I manually set it for Cygwin 1.7, the file does become read-only. (This issue was brought to my attention by a failing subversion test after building for 1.7.) ---------------------------------------------------------------------- [1.7] % mkdir /tmp/ro-test [1.7] % cd /tmp/ro-test [1.7] % ls -ld drwxr-xr-x+ 1 drothe None 0 Dec 31 15:18 . [1.7] % touch file1 [1.7] % ls -l total 0 -rw-r--r-- 1 drothe None 0 Dec 31 15:18 file1 [1.7] % chmod 444 file1 [1.7] % ls -l total 0 -r--r--r-- 1 drothe None 0 Dec 31 15:18 file1 [1.7] % test -w file1 && echo yes yes [1.7] % echo foo > file1 [1.7] % cat file1 foo [1.7] % attrib file1 A C:\cygwin-1.7\tmp\ro-test\file1 [1.7] % attrib +r file1 [1.7] % test -w file1 && echo yes [1.7] % echo bar > file1 bash: file1: Permission denied [1.7] % cat file1 foo ---------------------------------------------------------------------- Here is the same sequence of steps using Cygwin 1.5. ---------------------------------------------------------------------- [1.5] % mkdir /tmp/ro-test [1.5] % cd /tmp/ro-test [1.5] % ls -ld drwxr-xr-x+ 2 drothe None 0 Dec 31 15:21 . [1.5] % touch file1 [1.5] % ls -l total 0 -rw-r--r-- 1 drothe None 0 Dec 31 15:21 file1 [1.5] % chmod 444 file1 [1.5] % ls -l total 0 -r--r--r-- 1 drothe None 0 Dec 31 15:21 file1 [1.5] % test -w file1 && echo yes [1.5] % echo foo > file1 bash: file1: Permission denied [1.5] % cat file1 [1.5] % attrib file1 A R C:\cygwin\tmp\ro-test\file1 [1.5] % attrib -r file1 [1.5] % attrib file1 A C:\cygwin\tmp\ro-test\file1 [1.5] % ls -l total 0 -r--r--r-- 1 drothe None 0 Dec 31 15:21 file1 [1.5] % test -w file1 && echo yes yes [1.5] % echo foo > file1 bash: file1: Permission denied [1.5] % cat file1 ---------------------------------------------------------------------- -- David Rothenberger ---- daveroth@acm.org toilet toup'ee, n.: Any shag carpet that causes the lid to become top-heavy, thus creating endless annoyance to male users. -- Rich Hall, "Sniglets" -- 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/