X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Message-ID: <4E271C9E.3060408@redhat.com> Date: Wed, 20 Jul 2011 12:21:18 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: [ -w filename ] returns true when permissions are -r--r--r-- References: <1311185147 DOT 5730 DOT 20 DOT camel AT raker DOT ateb DOT com> In-Reply-To: <1311185147.5730.20.camel@raker.ateb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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. -- Eric Blake eblake AT redhat DOT com +1-801-349-2682 Libvirt virtualization library http://libvirt.org -- 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