Re: User mounting take 2



On Sat, Apr 15, 2006 at 01:05:45AM -0400, Joe Marcus Clarke wrote:
Based on feedback I received on my initial diff, I took another crack at
user mounting. To address Robert's concerns, I drop the setuid
permissions until needed. Therefore, all permission checks are now done
in the kernel. The same is true for umount(8).

silby asked for wildcard support. To handle that, I added glob support
to both the fs_file and fs_spec fstab components (via fnmatch(3)), and
also added a special %u pattern that can be used to represent the
current user (i.e. the user running mount(8)). This effectively allows
the following in /etc/fstab:

//%u@server/homes /home/%u/smb_home smbfs rw,noauto,user 0 0

Then, a user could just run, for example:

mount /home/marcus/smb_home

And their SMB home directory would get mounted (~/.nsmbrc is also
respected).

Additionally, something like the following is also possible:

/dev/acd0 /home/*/cdrom cd9660 ro,noauto,user 0 0

Same mount command works here:

mount /home/marcus/cdrom

Wildcards can also be mixed and matched.

Finally, in testing this, I found a problem with smbfs, msdosfs, and
ntfs relating to the statfs(2) f_flags field. smbfs always set this to
0, msdosfs didn't set this at all, and ntfs set this to all flags (not
just those visible to statfs(2)). By fixing this, umount(8) works
properly on relative paths to user mount points for those three file
systems.

http://www.marcuscom.com/downloads/usermount.diff

Comments?

Great feature! Hopefully it will hit the tree soon enough. Thanks!

-ip

--
A free agent is anything but.
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • User mounting take 2
    ... permissions until needed. ... Same mount command works here: ... ntfs relating to the statfsf_flags field. ... FreeBSD GNOME Team:: gnome@xxxxxxxxxxx ...
    (freebsd-hackers)
  • Re: writeprotection of unmounted mountpoints automaitcally - possible??
    ... >>options should change the permissions. ... Changing the mount point options does not affect the mount ... root can still write to the raw device, ... will be usable by the regular user, but the directory will not be ...
    (Fedora)
  • Re: [RFC] FUSE permission modell (Was: fuse review bits)
    ... > 2) Suid and device semantics should be disabled within the mount ... I can see plenty of uses where I want a filesystem generated by ... permissions model - which will break some programs? ... For most virtual filesystems, the "remote" information does not map to ...
    (Linux-Kernel)
  • Re: R/W access of a vfat partition by any user ?
    ... FAT32 partition will be writable by any user instead of just root. ... users Allow every user to mount and unmount the file system. ... The 'umask=022' makes all files and directories have rwxr-xr-x permissions. ... If you want different perms and you don't speak binary, ...
    (alt.os.linux.suse)
  • Re: RELENG_6 weird .. permission troubles
    ... YT>> JW> I've seen something very similar when the permissions of the mount point's ... To the best of my knowledge, the underlying mount point ... YT> permissions should affect nothing since the FS was mounted. ... root@woozle:/var/tmp# exit ...
    (freebsd-stable)