Finding symlink information in MAC Framework

s s at samu.pl
Fri Jul 15 17:18:19 UTC 2011


 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


More information about the freebsd-hackers mailing list