From owner-cvs-src@FreeBSD.ORG Tue Jul 6 11:06:56 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAF0516A4CE; Tue, 6 Jul 2004 11:06:56 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6679543D1F; Tue, 6 Jul 2004 11:06:56 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 82E62ACADB; Tue, 6 Jul 2004 13:06:55 +0200 (CEST) Date: Tue, 6 Jul 2004 13:06:55 +0200 From: Pawel Jakub Dawidek To: Alfred Perlstein Message-ID: <20040706110655.GJ12007@darkness.comp.waw.pl> References: <200407060937.i669biO0015330@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wZTxhqwJpWaw9Sch" Content-Disposition: inline In-Reply-To: <200407060937.i669biO0015330@repoman.freebsd.org> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 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-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 11:06:57 -0000 --wZTxhqwJpWaw9Sch Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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) =3D=3D 0 || +> + mp->mnt_cred->cr_uid !=3D td->td_ucred->cr_uid) { +> + if ((error =3D suser(td)) !=3D 0) +> + return (error); +> + } +> + return (0); +> } Do you really need a thread pointer in here? Could you replace it with just 'cred' structure? --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --wZTxhqwJpWaw9Sch Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA6ofPForvXbEpPzQRArUhAKCfjqTdznHCKtLiBYq32zZu1Xh+cQCbBeC9 eohtSlU/QQ2N/owS8TGS81k= =xGmQ -----END PGP SIGNATURE----- --wZTxhqwJpWaw9Sch--