From 3706cd350927f08fa8742cce9448c9ba8e4d6b2c Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 27 Feb 2002 18:32:23 +0000 Subject: Simple p_ucred -> td_ucred changes to start using the per-thread ucred reference. --- sys/security/lomac/kernel_mmap.c | 2 +- sys/security/lomac/kernel_socket.c | 4 ++-- sys/security/lomac/kernel_util.c | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'sys/security/lomac') diff --git a/sys/security/lomac/kernel_mmap.c b/sys/security/lomac/kernel_mmap.c index 6b01dc7..40d53e6 100644 --- a/sys/security/lomac/kernel_mmap.c +++ b/sys/security/lomac/kernel_mmap.c @@ -345,7 +345,7 @@ mmap(td, uap) struct vattr va; if ((error = VOP_GETATTR(vp, &va, - p->p_ucred, td))) { + td->td_ucred, td))) { goto done; } if ((va.va_flags & diff --git a/sys/security/lomac/kernel_socket.c b/sys/security/lomac/kernel_socket.c index 3ed2ee1..cc432a0 100644 --- a/sys/security/lomac/kernel_socket.c +++ b/sys/security/lomac/kernel_socket.c @@ -232,7 +232,7 @@ lomac_local_connect(struct socket *so, struct sockaddr *nam, struct thread *td) error = ENOTSOCK; goto bad; } - error = VOP_ACCESS(vp, VWRITE, td->td_proc->p_ucred, td); + error = VOP_ACCESS(vp, VWRITE, td->td_ucred, td); if (error) goto bad; so2 = vp->v_socket; @@ -265,7 +265,7 @@ lomac_local_connect(struct socket *so, struct sockaddr *nam, struct thread *td) * from its process structure at the time of connect() * (which is now). */ - cru2x(td->td_proc->p_ucred, &unp3->unp_peercred); + cru2x(td->td_ucred, &unp3->unp_peercred); unp3->unp_flags |= UNP_HAVEPC; /* * The receiver's (server's) credentials are copied diff --git a/sys/security/lomac/kernel_util.c b/sys/security/lomac/kernel_util.c index 9a7a0ab..8a57a2b 100644 --- a/sys/security/lomac/kernel_util.c +++ b/sys/security/lomac/kernel_util.c @@ -383,7 +383,7 @@ unmount(td, uap) */ if (!mediate_subject_at_level("unmount", td->td_proc, LOMAC_HIGHEST_LEVEL) || - ((mp->mnt_stat.f_owner != td->td_proc->p_ucred->cr_uid) && + ((mp->mnt_stat.f_owner != td->td_ucred->cr_uid) && (error = suser_td(td)))) { vput(vp); return (error); @@ -661,8 +661,7 @@ lomac_do_recwd(struct proc *p) { if (vp->v_type != VDIR) error = ENOTDIR; else - error = VOP_ACCESS(vp, VEXEC, td->td_proc->p_ucred, - curthread); + error = VOP_ACCESS(vp, VEXEC, td->td_ucred, curthread); if (error) vput(vp); else { -- cgit v1.1