delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/07/00:39:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4B45739C.4060807@fastmail.fm>
Date: Thu, 07 Jan 2010 00:39:40 -0500
From: Raman Gupta <rocketraman AT fastmail DOT fm>
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091130 Lightning/1.0b2pre Thunderbird/3.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.1-1 noacl on samba share has incorrect directory write bit
References: <4B454550 DOT 9020806 AT fastmail DOT fm> <4B454E96 DOT 7060009 AT cygwin DOT com>
In-Reply-To: <4B454E96.7060009@cygwin.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 01/06/2010 10:01 PM, Larry Hall (Cygwin) wrote:
> On 01/06/2010 09:22 PM, Raman Gupta wrote:
>> I have an smbfs mount (served by samba 3.4.2) in noacl mode on cygwin
>> 1.7.1-1:
>>
>> //smserver/smshare on /mnt/shar type smbfs (binary,notexec,noacl,user)
>>
>> Here is the directory as seen on the unix server directly:
>>
>> root AT smserver foo]# ls -ald bar
>> dr-xr-sr-x. 2 root agroup 4096 2007-04-21 23:23 bar
>>
>> As you can see, the directory bar is not writable.
>>
>> However, here is what cygwin in noacl mode sees:
>>
>> Raman Gupta AT client /mnt/shar/foo
>> $ ls -ald bar
>> drwxr-xr-x 1 Raman Gupta None 0 2007-04-21 23:23 bar
>>
>> The mode shown is 755 rather than 555, and indeed cygwin does not have
>> write access to this directory:
>>
>> Raman Gupta AT client /mnt/shar/foo/bar
>> $ touch baz
>> touch: cannot touch `baz': Permission denied
>>
>> Shouldn't cygwin therefore read the permissions as 555?
>>
>> In acl mode, cygwin does correctly show these directory permissions as
>> 555.
>>
>> Note that read-only *files* are correctly displayed by cygwin/noacl as
>> 444.
>
> Well, you've told Cygwin that it shouldn't consult the file system
> for permissions. So you see is what Cygwin defaults to in these
> situations. If you ask Cygwin to tell you the permissions on
> something in a file system where you also told it not to check the
> permissions, you don't expect to see  the actual correct
 > permissions, do you?

Well... yes -- at least in this case. As per the documentation 
(http://www.cygwin.com/cygwin-ug-net/using.html#mount-table):

"Cygwin ignores filesystem ACLs and only fakes a subset of permission 
bits based on the DOS readonly attribute"

On the server:

root AT smserver foo]# ls -ald bar baz
dr-xr-sr-x. 2 root agroup 4096 2007-04-21 23:23 bar
drwxrwsr-x. 2 root agroup 4096 2007-04-21 23:23 baz

Since the default behavior of Samba is to map the DOS read-only flag 
as per the write bits 
(http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#MAPREADONLY), 
the write bits carry over to the DOS readonly attribute on the share. 
This can be verified via the DOS attrib command on the client:

Raman Gupta AT client /mnt/shar/foo
$ attrib bar
      R     \\smserver\smshare\foo\bar

Raman Gupta AT client /mnt/shar/foo
$ attrib baz
            \\smserver\smshare\foo\baz

and yet, Cygwin reports owner write bit set in both cases:

Raman Gupta AT client /mnt/shar/foo
$ ls -ald bar baz
drwxr-xr-x 1 Raman Gupta None 0 2007-04-21 23:23 bar
drwxr-xr-x 1 Raman Gupta None 0 2007-04-21 23:23 baz

Therefore, it appears that cygwin is following its own documentation 
for files but not for directories.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019