Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Feb 2006 16:27:53 +0530
From:      Rohit Jalan <rohitj@purpe.com>
To:        current@freebsd.org
Subject:   Kern_symlink(...) is not setting vattr.va_type
Message-ID:  <20060227105753.GA6726@desk01.n2.purpe.com>

next in thread | raw e-mail | index | archive | help
Hi,

I've reproduced the following from vfs_syscalls.c,v 1.399.  
Vattr.va_type is set only if MAC is defined, should not it
be set always? Or is setting the same a responsibility of 
VOP_SYMLINK()?

Kern_fifo() sets vattr.va_type before calling VOP_MKNOD().


int
kern_symlink(struct thread *td, char *path, char *link, enum uio_seg segflg)
{
...
	FILEDESC_UNLOCK_FAST(td->td_proc->p_fd);
#ifdef MAC
	vattr.va_type = VLNK;
	error = mac_check_vnode_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd,
	    &vattr);
	if (error)
		goto out2;
#endif
	VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE);
	error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, syspath);
...
}


rohit --



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060227105753.GA6726>