Date: Tue, 6 Jul 2004 11:25:03 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys mount.h src/sys/kern vfs_subr.c Message-ID: <20040706182503.GW95729@elvis.mu.org> In-Reply-To: <20040706110655.GJ12007@darkness.comp.waw.pl> References: <200407060937.i669biO0015330@repoman.freebsd.org> <20040706110655.GJ12007@darkness.comp.waw.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
* Pawel Jakub Dawidek <pjd@FreeBSD.org> [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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040706182503.GW95729>
