Martin von Gagern
2006-Dec-17 22:47 UTC
[Samba] fstab based shared user mounts not possible
Hi! I first reported this issue as http://bugs.gentoo.org/136272 Mounting windows shares as a normal user causes quite a lot of trouble for me, using samba 3.0.22. I have this entry in my /etc/fstab:> //workstation/share /mnt/mountpoint smbfs \ > user,noauto,username=un,password=pwd,uid=un,gid=users,\ > fmask=660,dmask=770,codepage=850 0 0With a root owned mount point I get this error message when I try to mount this using "mount /mnt/mountpoint":> cannot mount on /mnt/mountpoint: Operation not permitted > smbmnt failed: 1I can change the ownership of the mountpoint to the user most likely to use this mount. This is already a degradation, because I would want every user allowed to mount that share at the same location, the way it works with other "user" mounts. Now mount works, but umount causes me trouble:> umount: only root can unmount //workstation/share from /mnt/mountpointThis is only for umount, smbumount works. So overall as a workaround I can use smbmount and smbumount and have every user create a mount point owned by himself. But it would be great if SMB mounts could be handld just as any other mount specified in /etc/fstab. Especially as the smbmount manpage states that usually smbmount is invoked by mount, and using mount and smbumount is kind of asymmetric and unintuitive. On the gentoo bug report someone pointed out the function mount_ok in smbmnt.c that compares mountpoint owner to current user, aborting if they are different. I guess I'd wish smbmount and the mount wrapper to show different behaviour in this respect. I see smbmount called directly by users to mount shares by providing credentials to mountpoints they themselv own. On the other hand, mount is basically for the system administrator, except for the mounts allowed to users through the user option in fstab. Those mounts are to be usable by all users, without ever a care what kinde the mount actually is. Greetings, Martin von Gagern -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://lists.samba.org/archive/samba/attachments/20061217/fd7587b6/signature.bin
Martin von Gagern wrote:> I have this entry in my /etc/fstab: >> //workstation/share /mnt/mountpoint smbfs \ >> user,noauto,username=un,password=pwd,uid=un,gid=users,\ >> fmask=660,dmask=770,codepage=850 0 0Have you tried "users" instead of "user" in your options list? Using that option allows any user to umount that device. (And you do realize that /etc/fstab is world-readable, right?)