From owner-freebsd-stable@FreeBSD.ORG Thu Feb 9 14:09:24 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B241516A420 for ; Thu, 9 Feb 2006 14:09:24 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9107B43D49 for ; Thu, 9 Feb 2006 14:09:23 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ahsrqx@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k19E9Eu5013704 for ; Thu, 9 Feb 2006 15:09:20 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k19E9Edc013703; Thu, 9 Feb 2006 15:09:14 +0100 (CET) (envelope-from olli) Date: Thu, 9 Feb 2006 15:09:14 +0100 (CET) Message-Id: <200602091409.k19E9Edc013703@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG In-Reply-To: <43EA5DE1.9090803@gmx.de> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 09 Feb 2006 15:09:20 +0100 (CET) Cc: Subject: Re: Trouble with mounting USB stick as user X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2006 14:09:24 -0000 [LoN]Kamikaze wrote: > Oliver Fromme wrote: > > [LoN]Kamikaze wrote: > > > I think it's enough when the mount point is owned by the group, without > > > belonging to a user. Try: > > > # chown :operator /mountpoint > > > # chmod 0770 /mountpoint > > > > No. The mount point _must_ be owned by the user. > > > > How many times does that have to be repeated until > > people get it? :-) > > So why does it work fine on my system? I don't know. You either modified the kernel sources so it works with the group alone, or you are confusing things. The source code is pretty clear. The following excerpt is verbatim (including comment) from src/sys/kern/vfs_mount.c which implements the mount() syscall. /* * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. */ error = VOP_GETATTR(vp, &va, td->td_ucred, td); if (error) { vput(vp); return (error); } if (va.va_uid != td->td_ucred->cr_uid) { if ((error = suser(td)) != 0) { vput(vp); return (error); } } Note that the UID attribute (va_uid) of the vnode which represents the mount point (vp) is compared with the UID of the user credentials (cr_uid) from the current thread (td). No GIDs involved here, only UIDs. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "... there are two ways of constructing a software design: One way is to make it so simple that there are _obviously_ no deficiencies and the other way is to make it so complicated that there are no _obvious_ deficiencies." -- C.A.R. Hoare, ACM Turing Award Lecture, 1980