[Samba] fstab based shared user mounts not possible

Martin von Gagern Martin.vGagern at gmx.net
Sun Dec 17 22:47:26 GMT 2006

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 0

With 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: 1

I 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/mountpoint

This 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.

 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

More information about the samba mailing list