From owner-cvs-all@FreeBSD.ORG Tue Jul 6 18:25:03 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC06816A4CF; Tue, 6 Jul 2004 18:25:03 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADB6343D53; Tue, 6 Jul 2004 18:25:03 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 903475C852; Tue, 6 Jul 2004 11:25:03 -0700 (PDT) Date: Tue, 6 Jul 2004 11:25:03 -0700 From: Alfred Perlstein To: Pawel Jakub Dawidek Message-ID: <20040706182503.GW95729@elvis.mu.org> References: <200407060937.i669biO0015330@repoman.freebsd.org> <20040706110655.GJ12007@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040706110655.GJ12007@darkness.comp.waw.pl> User-Agent: Mutt/1.4.2.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mount.h src/sys/kern vfs_subr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 18:25:04 -0000 * Pawel Jakub Dawidek [040706 04:06] wrote: > On Tue, Jul 06, 2004 at 09:37:44AM +0000, Alfred Perlstein wrote: > +> +/* > +> + * Check if a user can access priveledged mount options. > +> + */ > +> +int > +> +vfs_suser(struct mount *mp, struct thread *td) > +> +{ > +> + int error; > +> + > +> + if ((mp->mnt_flag & MNT_USER) == 0 || > +> + mp->mnt_cred->cr_uid != td->td_ucred->cr_uid) { > +> + if ((error = suser(td)) != 0) > +> + return (error); > +> + } > +> + return (0); > +> } > > Do you really need a thread pointer in here? > Could you replace it with just 'cred' structure? That's what vfs_suser_cred() will do if it's needed. :) -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684