X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SARE_UNSUB22,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4CACEB0A.4030609@fastmail.fm>
Date: Wed, 06 Oct 2010 17:32:58 -0400
From: Raman Gupta <rocketraman@fastmail.fm>
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b3pre Thunderbird/3.1.4
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: In what way is /cygdrive special WRT to permissions?
References: <9872BD92701C494686D002F1620610D0@ahallpc> <20101006084740.GS5480@calimero.vinschen.de> <5F51089A175A41AC8A69F08E6335F64C@ahallpc> <20101006204250.GB5480@calimero.vinschen.de>
In-Reply-To: <20101006204250.GB5480@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes
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 10/06/2010 04:42 PM, Corinna Vinschen wrote:
> On Oct  6 13:19, Andy Hall wrote:
>> Notice that the test -w /cygdrive/f/builds reports that /cygdrive/f/builds
>> is not writeable, yet you can create and write files in /cygdrive/f/builds!
>> THIS IS INCONSTENT BEHAVIOR.  Cygwin 1.5 did not have this behavior.
> 
> I somehow doubt that.  I'm just not sure if I can explain that
> correctly, given how tired I am.  The difference is that under 1.5 all
> smb drives were by default mounted with "noacl", aka
> "CYGWIN=nosmbntsec".  So all permissions were just faked and Cygwin's
> access call was more or less a wild guess.  With a drive mounted with
> "acl" the OS (yes, Windows itself) is asked if the current user has
> write permissions, based on the current user token and the ACL of the
> file.  Apparently "non writable" is what you get here, because the ACL
> returned by the Samba drive only contains the ACEs for the Linux user and
> group, not for your current Windows user and group.  You can add these
> Linux user's and groups to your local passwd and group file (see
> http://cygwin.com/cygwin-ug-net/using-utils.html#mkpasswd and
> http://cygwin.com/cygwin-ug-net/using-utils.html#mkgroup), but it won't
> change what the OS returns in the access check.  I'm sorry, this bugs
> me for years, but there nothing Cygwin can do about this.  Nor can Samba
> do anything.  Yes, I asked on the samba developer mailing list at one
> point...

Note that not only can you not trust the acl's as per Corinna's
message above when in acl mode, you also can't trust the write bit for
directories in the noacl mode, because samba uses the FAT read-only
bit to provide this information, but Windows and Cygwin do not. See
this thread:

http://cygwin.com/ml/cygwin/2010-01/msg00222.html

Basically, AFAICT, smbfs permissions are broken, though I suspect if
everything is running in a Windows Domain, with smbfs in acl mode,
things would work ok.

Cheers,
Raman

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

