Kern_symlink(...) is not setting vattr.va_type

Rohit Jalan rohitj at purpe.com
Mon Feb 27 02:58:06 PST 2006


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 --


More information about the freebsd-current mailing list