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

From: Rohit Jalan <rohitj_at_purpe.com>
Date: Mon, 27 Feb 2006 16:27:53 +0530
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 --
Received on Mon Feb 27 2006 - 09:58:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:52 UTC