SEAndroid中sepolicy/adbd.te策略文件分析

在adbd.te策略文件中,很明显,定义了一些关于adbd,也就是adb守护进程的一些策略.下面我们先来看一下这个策略源码:

# adbd seclabel is specified in init.rc since
# adbd安全标签是在init.rc中被指定的

# it lives in the rootfs and has no unique file type.
# 他存在于根文件系统中,没有唯一的文件类型。
type adbd, domain;    # 定义adbd类型标识符,其属性集合为domain

permissive adbd;      # 将adbd设置为permissive运行方式,也就是即使出现问题,也不会影响正常的运行,仅仅就是把错误发送给dmesg

unconfined_domain(adbd) # 无约束的域

# 直接调用宏,后面讲解;
# 在这里的作用是:通过执行一个被贴上标志符的文件来自动从旧域转到新域
domain_auto_trans(adbd, shell_exec, shell)

# this is an entrypoint
# 这是一个入口点
allow adbd rootfs:file entrypoint;

# Read /data/misc/adb/adb_keys.
# 读取 /data/misc/adb/adb_keys文件
allow adbd adb_keys_file:dir search;
allow adbd adb_keys_file:file r_file_perms;

# Allow access in case /data/misc/adb still has the old type.
# 当/data/misc/adb依然有旧域的话,也允许访问
allow adbd system_data_file:dir search;
allow adbd system_data_file:file r_file_perms;

总的来说,这里首先是定义了一个域标识符adbd,同时,设置了他的运行模式,也为该域定义了一些策略,允许其自动转换成新域,并且无论是新标志符还是旧标志符都可以访问/data/misc/adb下的文件.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天堂1223

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值