cvs commit: src/sys/sys mount.h src/sys/kern vfs_subr.c

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Jul 6 04:06:57 PDT 2004


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 at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20040706/9a27bf2b/attachment.bin


More information about the cvs-src mailing list