NDFREE(&nd, NDF_ONLY_PNBUF);
vp = nd.ni_vp;
/* Don't dump to non-regular files or files with links. */
/*
* Don't dump to non-regular files, files with links or files
* owned by someone else.
*/
if (vp->v_type != VREG ||
VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1) {
VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1 ||
vattr.va_mode & (S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) ||
vattr.va_uid != cred->cr_uid) {
VOP_UNLOCK(vp, 0);
error = EFAULT;
goto close;