This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [ -w filename ] returns true when permissions are -r--r--r--
- From: Eric Blake <eblake at redhat dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 20 Jul 2011 12:21:18 -0600
- Subject: Re: [ -w filename ] returns true when permissions are -r--r--r--
- References: <1311185147.5730.20.camel@raker.ateb.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@redhat.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