cvs commit: src/sys/sys mount.h src/sys/kern vfs_subr.c
Alfred Perlstein
alfred at freebsd.org
Tue Jul 6 11:25:04 PDT 2004
* Pawel Jakub Dawidek <pjd at 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 at mu.org cell: 408-480-4684
More information about the cvs-all
mailing list