Re: [Hampshire] Preventing Samba Directory Listing

Top Page

Reply to this message
Author: Simon Capstick
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Preventing Samba Directory Listing
Chris Aitken wrote:
>> I just tried to block directory listings of a particular samba share,
>> but still allow read/writes within it to explicitly named files. I
>> simply did a 'chmod g-r' on the directory in question. The result worked
>> on the Samba box and also on the Linux box that had the share mounted
>> via cifs. However opening a file (explicitly named) within MS Word 2007
>> on WinXP results in a file not found error message. My samba version is
>> 3.0.14a-Debian.
>>
>> Is my chmod g-r barking up the wrong tree or do I have a Windows issue?
>
> When Word opens a file, it creates a copy of the file in the same
> directory. You'll need to allow creation of that file type, or total
> write access to the share.
>
> Chris
>


Thanks Chris. I had forgotten that, although that doesn't seem to be
the problem since I can successfully create, read and write files from
the Linux CIFS mount, with the directory listing still blocked. It
turns out the Windows problem is more specific than I thought, and
probably off-topic for this mailing list. MS Word can open the file
when the filename is typed into the open file dialog. The specific case
where Word fails is when clicking on a 'samba' URL in Internet Explorer.
e.g. :
http://\\my-samba-server\Test\Test2.txt

Here are the permissions of my test Samba share which appear to work on
the whole except for the IE URL mentioned above...

Simon

imagine:/home/samba-shares# ls -al test
total 20
drwx-wx---   2 root  samba-test 4096 Jan 10 17:19 .
drwxr-xr-x  34 root  root       4096 Jan 10 17:05 ..
-rw-rw----   1 simon samba-test   28 Jan 10 17:19 Test.txt
-rw-rw----   1 simon samba-test   14 Jan 10 17:16 Test.txt~
-rw-rw----   1 simon samba-test    2 Jan 10 17:18 Test2.txt


smb.conf stanza...
[Test]
         comment = Test Share
         path = /home/samba-shares/test
         write list = samba-test
         force group = samba-test
         create mask = 660
         directory mask = 770
         force create mode = 660
         force directory mode = 770
         read only = No
         valid users = @samba-test