X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=3.3 required=5.0	tests=AWL,BAYES_00,BOTNET,RCVD_IN_DNSWL_NONE
X-Spam-Check-By: sourceware.org
Message-id: <4E28753C.2060101@cygwin.com>
Date: Thu, 21 Jul 2011 14:51:40 -0400
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh@cygwin.com>
Reply-to: cygwin@cygwin.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-version: 1.0
To: cygwin@cygwin.com
Subject: Re: [ -w filename ]  returns true when permissions are -r--r--r--
References: <4E271C9E.3060408@redhat.com> <2BF01EB27B56CC478AD6E5A0A28931F202EC7114@A1DAL1SWPES19MB.ams.acs-inc.net> <20110721133148.GL15150@calimero.vinschen.de>
In-reply-to: <20110721133148.GL15150@calimero.vinschen.de>
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

On 7/21/2011 9:31 AM, Corinna Vinschen wrote:
> On Jul 21 07:43, Nellis, Kenneth wrote:
>>> From: Eric Blake
>>> On 07/20/2011 12:05 PM, Reid Thompson wrote:
>>>> Is this broken?  Or a known windows/cygwin discrepancy?  Or am I
>>> missing
>>>> something with my posix/windows file permissions settings
>>>
>>> If you are running as an administrator, that might explain it.  Admins
>>> can alter any file regardless of permissions, in which case [ -w is
>>> telling you the truth that under your current uid, you can indeed write
>>> to the file.
>>>
>>> This is a feature of access(file,W_OK), and not a bug.
>>
>> FWIW, I'm not running as administrator and I'm running 1.7.9, and I'm
>> seeing the same thing:
>>
>> $ touch afile
>> $ chmod 444 afile
>> $ ls -l
>> total 0
>> -r--r--r-- 1 knellis knellis 0 Jul 21 08:36 afile
>> $ [ -w afile ]&&  echo writable || echo not writable
>> writable
>> $ echo abc>>  afile
>> $ cat afile
>> abc
>> $ ls -l
>> total 1
>> -r--r--r-- 1 knellis knellis 4 Jul 21 08:37 afile
>> $
>
> What system?  XP, Vista?  7?
> What's the output of `id'?

Or even <http://cygwin.com/snapshots/>. ;-)


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

