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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to