Android Selinux详解[八]--常用sepolicy函数和权限组说明

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

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 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值