X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Fri, 24 Sep 2010 18:28:26 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 1.7.7(0.230/5/3) - Cannot change mode of file, and other permission issues on a Windows fileshare
Message-ID: <20100924162826.GA25401@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <AANLkTi=F-QAnEhpPzZWn0xgseHg_MBnjM-1PaHqMaWjY@mail.gmail.com> <20100921165156.GD13235@calimero.vinschen.de> <AANLkTinJwrg330G0kEJRp5aL4Pdat6uyzqfsROFjANqL@mail.gmail.com> <20100924092627.GB6694@calimero.vinschen.de> <AANLkTikzf3WrnqHjoF28OPHRzWQzNHi-pfEtszbgjoSG@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <AANLkTikzf3WrnqHjoF28OPHRzWQzNHi-pfEtszbgjoSG@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
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

On Sep 24 08:49, Keith Christian wrote:
> > Does a call to chmod fail as well?  If so, can you create an strace of
> > such a chmod, like this:
> >
> >  $ touch foo
> >  $ strace -o chmod.trace chmod 444 foo
> >
> > and send the chmod.trace file to the list?
> 
> 
> 
> Thanks, Corinna,
> 
> Yes, I receive "chmod: changing permissions of `foo': Permission
> denied" when executing chmod 444 foo.

Here's the problem:

 fhandler_base::open: C0000022 = NtCreateFile (0x0, E0100, \??\Z:\foo, io, NULL, 0, 7, 1, 4000, NULL, 0)

Cygwin tries to open the file for writing the control information
requesting WRITE_DAC and WRITE_OWNER access, but the remote filesystem
refuses the request with an "Access denied" status code.

I was going to say that we can't do anything against that, but then
it occured to me that this isn't quite right.  Actually we don't
need WRITE_OWNER access for the chmod functionality, so it's perhaps 
still possible to call chmod on that remote filesystem if cygwin omits
the WRITE_OWNER access flag when opening the file.

I applied a tiny patch to Cygwin, which only requests WRITE_DAC, not
WRITE_OWNER in calls to chmod.  Please test the next developer's
snapshot from http://cygwin.com/snapshots/ and see if it fixes your
problem.  If you still get "Permission denied", it's actually a problem
of the server which doesn't allow to change the ACL of a file via the
share for some reason.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

