Date: Fri, 15 Jul 2011 19:18:16 +0200 From: s <s@samu.pl> To: <freebsd-hackers@freebsd.org> Subject: Finding symlink information in MAC Framework Message-ID: <c0c76b43d88b48a8b354df409b5167e5@samu.pl>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c0c76b43d88b48a8b354df409b5167e5>
