Mail Archives: cygwin/2010/01/08/11:51:12
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
- Raw text -