gpt4 book ai didi

android - Selinux 拒绝在 Android 8 上启动服务

转载 作者:行者123 更新时间:2023-11-30 05:05:35 25 4
gpt4 key购买 nike

最近我在使用 Android 8 并被 selinux 问题阻止了......

我在 init.rc 中创建一个“ppp”服务来启动 pppd,如下所示:

service ppp /system/bin/pppd call gprs
user root
group system radio
disabled
oneshot

但是当用命令“setprop ctl.start ppp”启动这个服务时它失败了。

selinux已经设置为permissive模式,但仍然显示如下,服务没有启动:

console:/ # [ 430.567622] init: Could not ctl.start for service ppp: File /system/bin/pppd(labeled "u:object_r:ppp_exec:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials

ppp.te 和 file_contexts 没有改变:

ppp.te:

typeattribute ppp coredomain;

domain_auto_trans(mtp, ppp_exec, ppp)

文件上下文:

/system/bin/pppd    u:object_r:ppp_exec:s0

感谢任何解决此问题的信息,在此先感谢!

最佳答案

当你使用“setprop ctl.start ppp”时,服务从init启动。

试试这个政策:

domain_auto_trans(init, ppp_exec, ppp)

关于android - Selinux 拒绝在 Android 8 上启动服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48272871/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com