X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Wed, 31 Dec 2008 22:38:30 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: [BUG 1.7] Read-only files are not.
Message-ID: <20090101033830.GA23640@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <495C00DF.5020208@acm.org> <loom.20090101T000200-655@post.gmane.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <loom.20090101T000200-655@post.gmane.org>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Note-from-DJ: This may be spam

On Thu, Jan 01, 2009 at 12:06:40AM +0000, Eric Blake wrote:
>David Rothenberger <daveroth <at> acm.org> writes:
>>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.
>
>Are you perchance running as an Administrator, and therefore you have
>backup privileges?  If so, then you have root-like power, and cygwin
>exposes that by opening files with intent to backup even when the ACLs
>would otherwise make the file unreadable.  Therefore, even though none
>of S_IRUSR, S_IRGRP, S_IROTH are set in the posixy st_mode bits,
>access(file, R_OK) returns 0 and open() is able to exploit your
>root-like powers to read that file.
>
>I thought Corinna mentioned this in the release notes.

Ah, right.  I remember when Corinna removed the "DOS" read-only bit.

I am running with Administrator privileges so I guess this behavior
makes sense.

cgf

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

