From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 15 17:18:19 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F41AA106564A for ; Fri, 15 Jul 2011 17:18:18 +0000 (UTC) (envelope-from s@samu.pl) Received: from samu.pl (samu.pl [IPv6:2001:41d0:1:f0cf::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9307C8FC0C for ; Fri, 15 Jul 2011 17:18:18 +0000 (UTC) Received: by samu.pl (Postfix, from userid 1001) id 0B320CDD20; Fri, 15 Jul 2011 19:18:17 +0200 (CEST) To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 15 Jul 2011 19:18:16 +0200 From: s Message-ID: X-Sender: s@samu.pl User-Agent: RoundCube Webmail/0.5.1 Subject: Finding symlink information in MAC Framework X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 17:18:19 -0000 Hello everyone, I am trying to get some information related to the symlink which is being accessed by the user in MAC Framework. Currently I managed to get the uid/gid of the owner of the symlink that is being read, but now I need to get the same information about the target, that the symlink points to. static int samplemac_vnode_check_link (struct ucred *cred, struct vnode *vp, struct label *vplabel) { int error; struct vattr vap; error = VOP_GETATTR(vp, &vap, cred); if (error) return (1); if(vap.va_uid != 0) { log(LOG_NOTICE, "stub_vnode_check_readlink: %i, gid: %i\n", vap.va_uid, vap.va_gid); return (0); } return (0); } And I have no idea how could I do that. Where should I look for that info? And what way would be the fastest? -- Pozdrawiam, Jakub 'samu' SzafraƄski