Use td->td_ucred instead of td->td_proc->p_ucred.
This commit is contained in:
parent
bccadd8dd3
commit
55b4beb561
@ -134,7 +134,7 @@ osf1_statfs(td, uap)
|
||||
sp = &mp->mnt_stat;
|
||||
vrele(nd.ni_vp);
|
||||
#ifdef MAC
|
||||
error = mac_check_mount_stat(td->td_proc->p_ucred, mp);
|
||||
error = mac_check_mount_stat(td->td_ucred, mp);
|
||||
if (error)
|
||||
return (error);
|
||||
#endif
|
||||
@ -161,7 +161,7 @@ osf1_fstatfs(td, uap)
|
||||
return (error);
|
||||
mp = ((struct vnode *)fp->f_data)->v_mount;
|
||||
#ifdef MAC
|
||||
error = mac_check_mount_stat(td->td_proc->p_ucred, mp);
|
||||
error = mac_check_mount_stat(td->td_ucred, mp);
|
||||
if (error) {
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
@ -198,7 +198,7 @@ osf1_getfsstat(td, uap)
|
||||
nmp = TAILQ_NEXT(mp, mnt_list);
|
||||
if (osf_sfsp && count < maxcount) {
|
||||
#ifdef MAC
|
||||
error = mac_check_mount_stat(td->td_proc->p_ucred, mp);
|
||||
error = mac_check_mount_stat(td->td_ucred, mp);
|
||||
if (error)
|
||||
continue;
|
||||
#endif
|
||||
|
@ -320,7 +320,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
|
||||
/*
|
||||
* Do directory search MAC check using non-cached credentials.
|
||||
*/
|
||||
if ((error = mac_check_vnode_readdir(td->td_proc->p_ucred, vp)))
|
||||
if ((error = mac_check_vnode_readdir(td->td_ucred, vp)))
|
||||
goto out;
|
||||
#endif /* MAC */
|
||||
if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies,
|
||||
|
@ -251,7 +251,7 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args)
|
||||
bsd_statfs = &mp->mnt_stat;
|
||||
vrele(ndp->ni_vp);
|
||||
#ifdef MAC
|
||||
error = mac_check_mount_stat(td->td_proc->p_ucred, mp);
|
||||
error = mac_check_mount_stat(td->td_ucred, mp);
|
||||
if (error)
|
||||
return (error);
|
||||
#endif
|
||||
@ -290,7 +290,7 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args)
|
||||
return error;
|
||||
mp = ((struct vnode *)fp->f_data)->v_mount;
|
||||
#ifdef MAC
|
||||
error = mac_check_mount_stat(td->td_proc->p_ucred, mp);
|
||||
error = mac_check_mount_stat(td->td_ucred, mp);
|
||||
if (error) {
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
@ -358,8 +358,7 @@ linux_ustat(struct thread *td, struct linux_ustat_args *args)
|
||||
if (vp->v_mount == NULL)
|
||||
return (EINVAL);
|
||||
#ifdef MAC
|
||||
error = mac_check_mount_stat(td->td_proc->p_ucred,
|
||||
vp->v_mount);
|
||||
error = mac_check_mount_stat(td->td_ucred, vp->v_mount);
|
||||
if (error)
|
||||
return (error);
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@
|
||||
drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p)
|
||||
{
|
||||
#if __FreeBSD_version >= 500021
|
||||
uid_t uid = p->td_proc->p_ucred->cr_svuid;
|
||||
uid_t uid = p->td_ucred->cr_svuid;
|
||||
pid_t pid = p->td_proc->p_pid;
|
||||
#else
|
||||
uid_t uid = p->p_cred->p_svuid;
|
||||
@ -75,7 +75,7 @@ int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p,
|
||||
priv = (drm_file_t *) DRM(alloc)(sizeof(*priv), DRM_MEM_FILES);
|
||||
bzero(priv, sizeof(*priv));
|
||||
#if __FreeBSD_version >= 500000
|
||||
priv->uid = p->td_proc->p_ucred->cr_svuid;
|
||||
priv->uid = p->td_ucred->cr_svuid;
|
||||
priv->pid = p->td_proc->p_pid;
|
||||
#else
|
||||
priv->uid = p->p_cred->p_svuid;
|
||||
|
@ -78,7 +78,7 @@ typedef void *RF_ThreadArg_t;
|
||||
static __inline struct ucred *
|
||||
rf_getucred(RF_Thread_t td)
|
||||
{
|
||||
return (((struct thread *)td)->td_proc->p_ucred);
|
||||
return (((struct thread *)td)->td_ucred);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
|
||||
|
||||
#ifdef MAC
|
||||
case SIOCGIFMAC:
|
||||
error = mac_ioctl_ifnet_get(td->td_proc->p_ucred, ifr, ifp);
|
||||
error = mac_ioctl_ifnet_get(td->td_ucred, ifr, ifp);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@ -1326,7 +1326,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
|
||||
|
||||
#ifdef MAC
|
||||
case SIOCSIFMAC:
|
||||
error = mac_ioctl_ifnet_set(td->td_proc->p_ucred, ifr, ifp);
|
||||
error = mac_ioctl_ifnet_set(td->td_ucred, ifr, ifp);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -642,7 +642,7 @@ ncp_sysctl_connstat(SYSCTL_HANDLER_ARGS)
|
||||
int error;
|
||||
struct ncp_conn_stat ncs;
|
||||
struct ncp_conn *ncp;
|
||||
/* struct ucred *cred = req->p->p_ucred;*/
|
||||
/* struct ucred *cred = req->td->td_ucred;*/
|
||||
|
||||
error = 0;
|
||||
sysctl_wire_old_buffer(req, 0);
|
||||
|
@ -108,7 +108,7 @@ mmopen(dev_t dev, int flags, int fmt, struct thread *td)
|
||||
case 0:
|
||||
case 1:
|
||||
if (flags & FWRITE) {
|
||||
error = securelevel_gt(td->td_proc->p_ucred, 0);
|
||||
error = securelevel_gt(td->td_ucred, 0);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ ffs_snapshot(mp, snapfile)
|
||||
mp_fixme("Unlocked GETATTR.");
|
||||
if (vrefcnt(xvp) == 0 || xvp->v_type == VNON ||
|
||||
(VTOI(xvp)->i_flags & SF_SNAPSHOT) ||
|
||||
(VOP_GETATTR(xvp, &vat, td->td_proc->p_ucred, td) == 0 &&
|
||||
(VOP_GETATTR(xvp, &vat, td->td_ucred, td) == 0 &&
|
||||
vat.va_nlink > 0)) {
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
continue;
|
||||
|
@ -199,7 +199,7 @@ ffs_mount(mp, path, data, ndp, td)
|
||||
* Flush any dirty data.
|
||||
*/
|
||||
if ((error = VFS_SYNC(mp, MNT_WAIT,
|
||||
td->td_proc->p_ucred, td)) != 0) {
|
||||
td->td_ucred, td)) != 0) {
|
||||
vn_finished_write(mp);
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user