te_macros中的函数以及global_macros权限组是我们在加sepolicy策略或者读sepolicy策略时经常碰到的,我们需要对其有所了解。
一)te_macros
te_macros中有很多函数,比如domain_auto_trans, r_dir_file等等,见源码中定义的地方
te_macros - OpenGrok cross reference for /system/sepolicy/public/te_macros
举例一两个看一下
1. domain_trans
##################################### # domain_trans(olddomain, type, newdomain) 用法-有三个入参,从旧的domain转为新的domain 含义如下: # Allow a transition from olddomain to newdomain # upon executing a file labeled with type. # This only allows the transition; it does not # cause it to occur automatically - use domain_auto_trans # if that is what you want. # --具体函数内容 define(`domain_trans', ` # Old domain may exec

本文介绍了OpenGroksepolicy中te_macros中的domain_trans和r_dir_file函数,以及global_macros中的常用权限组,帮助理解在策略文件中如何管理和应用这些权限控制。
最低0.47元/天 解锁文章
1176

被折叠的 条评论
为什么被折叠?



