From: Greg Russell on 5 Dec 2009 01:26 We have an M$-2000 and M$-XP share mounted. The XP share doesn't have ug+w permissions set for some reason, even though the share is defined as not read-only, and all users can change files etc. Can you help please? The mount points before the shares are mounted: $ ls -l /tmp $HOME/videos | egrep "w2k|wxp" drwxr-xr-x 2 me me 4096 Dec 4 19:36 wxp drwxr-xr-x 2 me me 4096 Oct 28 13:03 w2k The mount parameters are the same: # grep cifs /etc/fstab //10.0.0.3/unix /tmp/w2k cifs rw,uid=500,gid=500,password=sumthin,username=me 0 0 //10.0.0.98/Videos /home/me/videos/wxp cifs rw,uid=500,gid=500,password=sumthin,username=me 0 0 The cifs shares are mounted, then the mount point permissions change: # mount -a # ls -l /tmp /home/me/videos | egrep "w2k|wxp" dr-xr-xr-x 1 me me 0 Dec 4 20:03 wxp drwxrwxrwx 1 me me 0 Dec 4 19:48 w2k Root can write to the share, so XP is allowing rw: # touch /home/me/videos/junk But an ordinary user can't: $ touch /home/me/videos/junk touch: cannot touch `/home/me/videos/junk': Permission denied The ug+w permissions can't be changed either: $ chmod ug+w wxp $ ls -l | grep wxp dr-xr-xr-x 1 me me 0 Dec 4 20:03 wxp So, I'm stumped. How can I mount this cifs share in Linux and have it be writable please? No such problem exists with the W2000 share, and both M$ machines are members of workgroup "WORKGROUP". Specifying "domain=WORKGROUP" in the mount options doesn't change anything, nor does the presence of the sticky bit "o+t" on /home/me/videos/ as it exists on / tmp.
From: unruh on 5 Dec 2009 02:13 On 2009-12-05, Greg Russell <me(a)invalid.com> wrote: > We have an M$-2000 and M$-XP share mounted. The XP share doesn't have ug+w > permissions set for some reason, even though the share is defined as not > read-only, and all users can change files etc. Can you help please? > > The mount points before the shares are mounted: > > $ ls -l /tmp $HOME/videos | egrep "w2k|wxp" > drwxr-xr-x 2 me me 4096 Dec 4 19:36 wxp > drwxr-xr-x 2 me me 4096 Oct 28 13:03 w2k You tell it not to allow write on the base partitions. the permissions on a mount point are the least of the premissions of the original mount point and the permissions of the mounted directory. Ie, make the permissions of the mount points are chmod a+rwx wxp w2k then mount them. > > The mount parameters are the same: > > # grep cifs /etc/fstab //10.0.0.3/unix /tmp/w2k cifs > rw,uid=500,gid=500,password=sumthin,username=me 0 0 > //10.0.0.98/Videos /home/me/videos/wxp cifs > rw,uid=500,gid=500,password=sumthin,username=me 0 0 > > The cifs shares are mounted, then the mount point permissions change: > > # mount -a > # ls -l /tmp /home/me/videos | egrep "w2k|wxp" > dr-xr-xr-x 1 me me 0 Dec 4 20:03 wxp > drwxrwxrwx 1 me me 0 Dec 4 19:48 w2k > > Root can write to the share, so XP is allowing rw: > > # touch /home/me/videos/junk > > But an ordinary user can't: > > $ touch /home/me/videos/junk > touch: cannot touch `/home/me/videos/junk': Permission denied > > The ug+w permissions can't be changed either: > > $ chmod ug+w wxp > $ ls -l | grep wxp > dr-xr-xr-x 1 me me 0 Dec 4 20:03 wxp > > So, I'm stumped. How can I mount this cifs share in Linux and have it be > writable please? No such problem exists with the W2000 share, and both M$ > machines are members of workgroup "WORKGROUP". Specifying > "domain=WORKGROUP" in the mount options doesn't change anything, nor does > the presence of the sticky bit "o+t" on /home/me/videos/ as it exists on / > tmp. ??? You point out that the mount points do not allow writting but to not try to set them to allow writing. Why not? I am not sure that this is the problem but it is easy enough to try. > >
From: Chris Davies on 5 Dec 2009 14:12 Greg Russell <me(a)invalid.com> wrote: > We have an M$-2000 and M$-XP share mounted. The XP share doesn't have ug+w > permissions set for some reason, even though the share is defined as not > read-only, and all users can change files etc. Can you help please? > The mount parameters are the same: > # grep cifs /etc/fstab //10.0.0.3/unix /tmp/w2k cifs > rw,uid=500,gid=500,password=sumthin,username=me 0 0 > //10.0.0.98/Videos /home/me/videos/wxp cifs > rw,uid=500,gid=500,password=sumthin,username=me 0 0 > The cifs shares are mounted, then the mount point permissions change: > dr-xr-xr-x 1 me me 0 Dec 4 20:03 wxp > drwxrwxrwx 1 me me 0 Dec 4 19:48 w2k > So, I'm stumped. How can I mount this cifs share in Linux and have it be > writable please? No such problem exists with the W2000 share [...] Looking at man mount.cifs suggests you should use the file_mode and dir_mode arguments for systems that don't understand the CIFS UNIX extensions. Given your environment and mount parameters are the same, the difference between your W2K and XP servers could be CIFS UNIX support. You might also need to try the perm/noperm option if all else fails. Chris
From: Greg Russell on 5 Dec 2009 18:01 On Sat, 05 Dec 2009 19:12:50 +0000, Chris Davies wrote: >> So, I'm stumped. How can I mount this cifs share in Linux and have it >> be writable please? No such problem exists with the W2000 share [...] > > Looking at man mount.cifs suggests you should use the file_mode and > dir_mode arguments for systems that don't understand the CIFS UNIX > extensions. Given your environment and mount parameters are the same, > the difference between your W2K and XP servers could be CIFS UNIX > support. You might also need to try the perm/noperm option if all else > fails. As Unruh suggested, the mount-point perms were changed to: drwxrwxrwx 2 me me 4096 Dec 4 19:36 wxp And the /etc/fstab entry: //10.0.0.98/Videos /home/me/videos/wxp cifs file_mode=0777,dir_mode=0777,rw,uid=500,gid=500,password=sumthin,username=me,domain=WORKGROUP 0 0 After mounting, the results are unchanged: dr-xr-xr-x 1 me me 0 Dec 5 14:34 wxp Alternating usage of the perm and noperm options to mount.cifs also doesn't change the result. A very strange, non-sensical problem it is.
From: Chris Davies on 5 Dec 2009 18:29
Greg Russell <me(a)invalid.com> wrote: > So, I'm stumped. How can I mount this cifs share in Linux and have it > be writable please? No such problem exists with the W2000 share [...] > After mounting, the results are unchanged: > dr-xr-xr-x 1 me me 0 Dec 5 14:34 wxp I have a vague memory of a system that uses an NFS export from a Windows server of some sort, where the permissions looked daft but seem to work as we wanted. Returning to your original post, you did something like touch /some/file/on/the/partition first as root and then as an ordinary user. What if, as an ordinary user, you touch another file (specifically, one that doesn't yet exist). Despite it seeming that it shouldn't work, does it actually do so? Chris |