Re: perm error on mount point

Jeff Layton <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
On Wed, 17 Jun 2009 10:35:53 +0200
<[email protected]> wrote:

> 
> 
> Hi, 
> I've a problem with mount.cifs using kernel > 2.6.24 (so with cifs >
> 1.52). With some shares, permission on the mount point
> are not applied.
> 
> Test on debian base distro (kernel 2.6.26-2), when i mount using the
> option dir_mode=0755, the mask is not apply to 
> the mount point but just on the sub-dir. This problem occurs on some
> windows shares (that are automatically 
> made by a external program on my windows 2003 server). 
> 
> With the share "MYSHARE" : error (same error if i don't use dir_mode
> option)
> $> mount -t cifs //192.168.224.1/MYSHARE$ TEST -o
> username=admin,uid=10066,gid=10000,dir_mode=0755 --verbose
> $> ll .
> dr-xr-xr-x 1 admin utilisa._du_domaine 0 jun 11 17:14 TEST
> 
> With other share "OTHERSHARE" : ok (event if i don't use dir_mode option,
> permission are corrects)
> $> mount -t cifs //192.168.224.1/OTHERSHARE$ TEST -o
> username=admin,uid=10066,gid=10000,dir_mode=0755 --verbose
> $> ll .
> drwxr-xr-x 1 admin utilisa._du_domaine 0 jun 11 17:14 TEST
> 
> If i booted from kernel 2.6.24
> with exactly same command, everything works
> as expect for all shares:
> $> mount -t cifs //192.168.224.1/MYSHARE$ TEST -o
> username=admin,uid=10066,gid=10000,dir_mode=0755 --verbose
> $> ll .
> drwxr-xr-x 1 admin utilisa._du_domaine 0 jun 11 17:19 TEST
> 
> I use mount-2.13.1.1-1, smbfs-3.2.5-4lenny2 and samba-common-3.2.5-4lenny2
> 
> So why with kernel 2.6.26 dir_mode is not applied to the mount point on
> some share whereas with 2.6.24 it always works !
> 
> thanks,

It's probably because the server has the ATTR_READONLY bit set on the
directory that corresponds to MYSHARE$. Later versions of CIFS detect
this and clear all of the write bits in the mode when it's present.

-- 
Jeff Layton <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.