Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 2006 01:05:45 -0400
From:      Joe Marcus Clarke <marcus@FreeBSD.org>
To:        hackers@FreeBSD.org
Subject:   User mounting take 2
Message-ID:  <1145077545.83050.15.camel@shumai.marcuscom.com>

next in thread | raw e-mail | index | archive | help

--=-wMhOnLIF7YziXY1uFGwg
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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?

Joe

--=20
Joe Marcus Clarke
FreeBSD GNOME Team      ::      gnome@FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome

--=-wMhOnLIF7YziXY1uFGwg
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQBEQH8pb2iPiv4Uz4cRAlRAAJ96bl0rgO/AOrilqA3AlfzNX0SOrgCdFJhO
nbxnzqRvQtkzibbzmQ+nbwY=
=3LWH
-----END PGP SIGNATURE-----

--=-wMhOnLIF7YziXY1uFGwg--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1145077545.83050.15.camel>