Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_sig.c
Show First 20 Lines • Show All 3,865 Lines • ▼ Show 20 Lines | for (i = 0; i < ncores; i++) { | ||||
vp = nd.ni_vp; | vp = nd.ni_vp; | ||||
NDFREE_PNBUF(&nd); | NDFREE_PNBUF(&nd); | ||||
if ((flags & O_CREAT) == O_CREAT) { | if ((flags & O_CREAT) == O_CREAT) { | ||||
nextvp = vp; | nextvp = vp; | ||||
break; | break; | ||||
} | } | ||||
error = VOP_GETATTR(vp, &vattr, td->td_ucred); | error = VOP_GETATTR(vp, 0, &vattr, td->td_ucred); | ||||
if (error != 0) { | if (error != 0) { | ||||
vnode_close_locked(td, vp); | vnode_close_locked(td, vp); | ||||
break; | break; | ||||
} | } | ||||
if (oldvp == NULL || | if (oldvp == NULL || | ||||
lasttime.tv_sec > vattr.va_mtime.tv_sec || | lasttime.tv_sec > vattr.va_mtime.tv_sec || | ||||
(lasttime.tv_sec == vattr.va_mtime.tv_sec && | (lasttime.tv_sec == vattr.va_mtime.tv_sec && | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | error = corefile_open(p->p_comm, cred->cr_uid, p->p_pid, td, | ||||
compress_user_cores, p->p_sig, &vp, &name); | compress_user_cores, p->p_sig, &vp, &name); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
/* | /* | ||||
* Don't dump to non-regular files or files with links. | * Don't dump to non-regular files or files with links. | ||||
* Do not dump into system files. Effective user must own the corefile. | * Do not dump into system files. Effective user must own the corefile. | ||||
*/ | */ | ||||
if (vp->v_type != VREG || VOP_GETATTR(vp, &vattr, cred) != 0 || | if (vp->v_type != VREG || VOP_GETATTR(vp, 0, &vattr, cred) != 0 || | ||||
vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0 || | vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0 || | ||||
vattr.va_uid != cred->cr_uid) { | vattr.va_uid != cred->cr_uid) { | ||||
VOP_UNLOCK(vp); | VOP_UNLOCK(vp); | ||||
error = EFAULT; | error = EFAULT; | ||||
goto out; | goto out; | ||||
} | } | ||||
VOP_UNLOCK(vp); | VOP_UNLOCK(vp); | ||||
▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines |