From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 22 14:40:57 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD6A916A401 for ; Sat, 22 Apr 2006 14:40:57 +0000 (UTC) (envelope-from igor@doom.homeunix.org) Received: from mail.ecolines.ru (ns.ecolines.ru [81.3.181.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93D9D43D48 for ; Sat, 22 Apr 2006 14:40:54 +0000 (GMT) (envelope-from igor@doom.homeunix.org) Received: (qmail 8582 invoked from network); 22 Apr 2006 14:46:42 -0000 Received: from unknown (HELO doom.homeunix.org) (ip@212.113.114.49) by mail.ecolines.ru with ESMTPA; 22 Apr 2006 14:46:42 -0000 Received: from doom.homeunix.org (localhost [127.0.0.1]) by doom.homeunix.org (8.13.4/8.13.4) with ESMTP id k3M73cpO001193; Sat, 22 Apr 2006 11:03:39 +0400 (MSD) (envelope-from igor@doom.homeunix.org) Received: (from igor@localhost) by doom.homeunix.org (8.13.4/8.13.4/Submit) id k3L561ci006340; Fri, 21 Apr 2006 09:06:01 +0400 (MSD) (envelope-from igor) Date: Fri, 21 Apr 2006 09:05:41 +0400 From: Igor Pokrovsky To: Joe Marcus Clarke Message-ID: <20060421050541.GA3223@doom.homeunix.org> Mail-Followup-To: Joe Marcus Clarke , hackers@freebsd.org References: <1145077545.83050.15.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1145077545.83050.15.camel@shumai.marcuscom.com> User-Agent: Mutt/1.4.2.1i Cc: hackers@freebsd.org Subject: Re: User mounting take 2 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2006 14:40:57 -0000 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.