Subject: Re: Need some advice regarding portable user IDs
To: None <freebsd-hackers@FreeBSD.ORG, tech-userlevel@netbsd.org>
From: Wolfgang Solfrank <ws@tools.de>
List: tech-userlevel
Date: 08/18/1999 14:22:11
Hi,

> huh?  NetBSD (at least) allows non-root mounts (forced to
> nodev,nosuid, ..) if the user owns the mount point and has appropriate
> access to the underlying device..
> 
> I thought that was a 4.4Lite feature..

Yes, it was part of 4.4Lite2.

And I still have the discussion from 1994 between Chris Demetriou,
Kirk McKusick and myself which triggered this feature.  (For the record,
(the equivalent of) core@netbsd.org was CC'ed on this discussion, and
Theo kicked in later, too).

Back then, I was arguing to use the mounter's uid, if it wasn't root,
as owner for all files (well, we were discussing this more or less with
respect to msdosfs only, so you have to set some uid as the owner of files
anyway), but Chris was arguing that the man in front of the box should
be able to mount some floppy for some other guy and give him access to
his files.

Actually substituting the mounter for the owner of the files should be
quite easy to implement (since most filesystems now use the generic vaccess
routine for access checking, it wouldn't even require changes to most
filesystems), as the mounter is available in the mount structure anyway.
(It is checked on an unmount, so only the mounter (and root, of course)
can unmount a filesystem).  However, if we'd make it an option to the
generic mount code, it would probably be a good idea to make the
substitution uid and gid extra arguments to the mount command for the
reasons Chris mentioned back then.

Ciao,
Wolfgang

PS: BTW, shouldn't this be on tech-kern@netbsd.org instead of
tech-userlevel?
-- 
ws@TooLs.DE     (Wolfgang Solfrank, TooLs GmbH) 	+49-228-985800