X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 	tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4B47626B.4060104@fastmail.fm>
Date: Fri, 08 Jan 2010 11:50:51 -0500
From: Raman Gupta <rocketraman@fastmail.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@cygwin.com
Subject: Re: 1.7.1-1 noacl on samba share has incorrect directory write bit
References: <4B454550.9020806@fastmail.fm>  <4B454E96.7060009@cygwin.com>  <4B45739C.4060807@fastmail.fm>  <20100107180214.GP23972@calimero.vinschen.de>  <4B462AFD.8030809@fastmail.fm>  <20100107195022.GQ23972@calimero.vinschen.de>  <4B463D68.1070906@fastmail.fm>  <20100107200946.GR23972@calimero.vinschen.de>  <4B46431E.7050101@fastmail.fm> <20100108103215.GB27916@calimero.vinschen.de>
In-Reply-To: <20100108103215.GB27916@calimero.vinschen.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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 01/08/2010 05:32 AM, Corinna Vinschen wrote:
> On Jan  7 15:25, Raman Gupta wrote:
>> On 01/07/2010 03:09 PM, Corinna Vinschen wrote:
>>> I'm talking about the other case.  The DOS R/O flag has nothing to do
>>> with writability of a directory in the first place.  If we treat a
>>> directory as non-writable just because the DOS R/O flag is set, we're
>>> making a mistake with consequences.  The consequences in the opposite
>>> case are much less problematic.
>>
>> Right -- which is why I suggested gating this using a "dro/nodro"
>> attribute so that it could be turned on by users of noacl samba
>> mounts where it would be correct to turn it on -- I suspect noacl
>> samba mounts are widely used and would benefit greatly from this as
>> EACCES would be correctly returned in many situations in which it
>> currently isn't.
>
> Show me an example.  The actual permissions are so that your actions
> already return EACCES.  I don't see lots of a win which would rectify
> another mount option.

Here is a simple foundational example -- assume "foo" is a 
non-writable directory on an smbfs share mounted with noacl, using the 
default samba share options:

$ if [[ -w foo ]]; then echo "writable"; else echo "not writable"; fi;
writable

which is of course incorrect as the directory is not actually writable:

$ touch foo/bar
touch: cannot touch `foo/bar': Permission denied

Another example is copying (with perms) from a noacl mount to an acl 
mount. The permissions of directories copied to the acl mount should 
be non-writable (and would be with the dro option) but currently the 
permissions on the acl mount are incorrectly set as writable:

Assume the following mounts:

//s/a on /mnt/acl type smbfs (binary,notexec,user)
//s/a on /mnt/noacl type smbfs (binary,notexec,noacl,user)
C:/cygwin on / type ntfs (binary,auto)

Share "a", again using the default samba options, contains a 
non-writable directory called "foo":

Now run:

$ mkdir /tmp/from_acl; mkdir /tmp/from_noacl

$ unison -auto -batch /mnt/acl /tmp/from_acl
[...]

$ unison -auto -batch /mnt/noacl /tmp/from_noacl
[...]

$ ls -l /tmp/from_acl
total 0
dr-x------+ 1 Raman Gupta None 0 2010-01-08 11:36 foo

$ ls -l /tmp/from_noacl
total 0
drwx------+ 1 Raman Gupta None 0 2010-01-08 11:36 foo

With the dro option, the latter would correctly remove the write bit 
on foo in /tmp/from_noacl.

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

