Date: Tue, 6 Jul 2004 13:06:55 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Alfred Perlstein <alfred@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mount.h src/sys/kern vfs_subr.c Message-ID: <20040706110655.GJ12007@darkness.comp.waw.pl> In-Reply-To: <200407060937.i669biO0015330@repoman.freebsd.org> References: <200407060937.i669biO0015330@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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?
--
Pawel Jakub Dawidek http://www.FreeBSD.org
pjd@FreeBSD.org http://garage.freebsd.pl
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFA6ofPForvXbEpPzQRArUhAKCfjqTdznHCKtLiBYq32zZu1Xh+cQCbBeC9
eohtSlU/QQ2N/owS8TGS81k=
=xGmQ
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040706110655.GJ12007>
