From owner-freebsd-current@FreeBSD.ORG Mon Feb 27 10:58:06 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF48016A420 for ; Mon, 27 Feb 2006 10:58:06 +0000 (GMT) (envelope-from rohitj@purpe.com) Received: from fed1rmmtao11.cox.net (fed1rmmtao11.cox.net [68.230.241.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id E832043D6D for ; Mon, 27 Feb 2006 10:58:00 +0000 (GMT) (envelope-from rohitj@purpe.com) Received: from serv01.n1.purpe.com ([68.0.152.17]) by fed1rmmtao11.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060227105621.ISM6244.fed1rmmtao11.cox.net@serv01.n1.purpe.com> for ; Mon, 27 Feb 2006 05:56:21 -0500 Received: from desk01.n2.purpe.com (desk01.n2.purpe.com [192.168.19.1]) by serv01.n1.purpe.com (8.12.10/8.12.10) with ESMTP id k1RAvucU020564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Feb 2006 03:57:59 -0700 (MST) (envelope-from rohitj@desk01.n2.purpe.com) Received: from desk01.n2.purpe.com (localhost [127.0.0.1]) by desk01.n2.purpe.com (8.13.4/8.13.4) with ESMTP id k1RAvskI006781 for ; Mon, 27 Feb 2006 16:27:54 +0530 (IST) (envelope-from rohitj@desk01.n2.purpe.com) Received: (from rohitj@localhost) by desk01.n2.purpe.com (8.13.4/8.13.4/Submit) id k1RAvsP9006780 for current@freebsd.org; Mon, 27 Feb 2006 16:27:54 +0530 (IST) (envelope-from rohitj) Date: Mon, 27 Feb 2006 16:27:53 +0530 From: Rohit Jalan To: current@freebsd.org Message-ID: <20060227105753.GA6726@desk01.n2.purpe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Archived: msg.Vm5z28ZA0@serv01.n1.purpe.com Cc: Subject: Kern_symlink(...) is not setting vattr.va_type X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 10:58:06 -0000 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 --