Skip site navigation (1)Skip section navigation (2)
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

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040706110655.GJ12007>