本文转载自:https://blog.csdn.net/yin1031468524/article/details/75644874

在系统中添加某个“*.te”后,可能会出现下面的错误:

libsepol.report_failure: neverallow on line 263 of system/sepolicy/domain.te (or line 9133 of policy.conf) violated by allow xx device:chr_file { read write open };
    libsepol.check_assertions: 1 neverallow failures occurred
    Error while expanding policy

这是因为在“system/sepolicy/domain.te” 添加了一些neverallow rules,导致编译检查的时候出现错误

# Do not allow any domain other than init or recovery to create unlabeled files.
    neverallow { domain -init -recovery } unlabeled:dir_file_class_set create;

只需要根据错误的提示,在system/sepolicy/domain.te找到对应的neverallow规则修改即可,我编译出现error的是allow xx device:chr_file { read write open };

只需要在下面的规则中,去掉我们添加的xx.te即可,在neverallow后的第一个‘{}’里 利用“-xx”,排除某个,即不应有此规则

# Don't allow raw read/write/open access to generic devices.
    # Rather force a relabel to a more specific type.
    # init is exempt from this as there are character devices that only it uses.
    # ueventd is exempt from this, as it is managing these devices.
    neverallow { domain -init -ueventd -systool_server -xx } device:chr_file { open read write };

修改sepolicy后编译出现‘Error while expanding policy’【转】的更多相关文章

  1. sharepoint服务器修改密码后出现HTTP Error 503

    HTTP Error 503   解决办法: 更改sharepoint 网站应用程序池标示后,更改标示重新输入管理员密码,问题解决!

  2. 修改OpenSSL默认编译出的动态库文件名称

    在 Windows 平台上调用动态链接库 dll 文件时,有两种方式:a) 隐式的加载时链接:使用 *.lib (导入库)文件,在 IDE 的链接器相关设置中加入导入库 lib 文件的名称,或在程序中 ...

  3. IAR编译错误Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is too long for segment definition. At least 0x8 more bytes needed. The problem occurred while processing the segment

    问题:个人使用的是IARV9.10编译CC2541的工程,没有做任何修改,直接编译出现如下错误 Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is ...

  4. C++ 升级到 Vs2013后编译设置

    编译 EasyDarwin 时,Vs2008的C++升级到 Vs2013时报错: 1. 找不到 windows.h 项目->属性->配置属性->C/C++->所有选项: 附加包 ...

  5. Apache的编译安装error: APR not found. Please read the documentation

    提示configure: error: APR not found. Please read the documentation. 经网上查阅资料才知道这是Apache的关联软件 在apr.apach ...

  6. VS2013 编译错误 error: MSB8031

    VS2010 创建的 MFC 程序,用 VS2013 打开后编译出现错误: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microso ...

  7. .net core 发布后提示Start error

    纪录篇: 发布Core版本的项目后一直提示error,通过网络查询资料后确认梳理问题的逻辑   1.验证环境是否支持,开发环境及server环境        参考:https://docs.micr ...

  8. Android studio 编译失败Error:Could not read entry ':app:processDebugManifest' from cache taskArtifacts.b

    Android studio 编译失败 Error:Could not read entry ':app:processDebugManifest' from cache taskArtifacts. ...

  9. spring boot修改代码后无需重启设置,在开发时实现热部署

    Spring Boot在开发时实现热部署(开发时修改文件保存后自动重启应用)(spring-boot-devtools) 热部署是什么 大家都知道在项目开发过程中,常常会改动页面数据或者修改数据结构, ...

随机推荐

  1. Mongodb 文档时间字段修改

    mongo文档[tblEvent]如下: {     "_id" : ObjectId("5a0415f9bf28b684b1c7f5b2"),     &qu ...

  2. MYSQLi数据访问批量删除

    <link href="../bootstrap.min.css" rel="stylesheet" type="text/css" ...

  3. CNN超参数优化和可视化技巧详解

    https://zhuanlan.zhihu.com/p/27905191 在深度学习中,有许多不同的深度网络结构,包括卷积神经网络(CNN或convnet).长短期记忆网络(LSTM)和生成对抗网络 ...

  4. Codeforces Round #323

    div1 C 这题的是给了一个无限循环的子数组,问有多少个 (l,s)l代表起点s代表长度的循环串,使得所有的在原串中的每位都小于等于另外这个串(l<=n,1<=s<n) 像这样,我 ...

  5. Acperience (英语阅读 + 数学推导)

    #include<bits/stdc++.h> using namespace std; int main(){ int T,n,m;scanf("%d",&T ...

  6. 仿照admin的stark自定义组件的功能实现

    仿照admin的stark自定义组件的功能实现:其中最主要的就是增删改查的实现 1.查:首先页面中显示表头和数据,都是动态的,而不是写死的. (1) 先看表头和表单数据:这个是查看的视图函数,但是为了 ...

  7. 常见的原生javascript DOM操作

    1.创建元素 创建元素:document.createElement() 使用document.createElement()可以创建新元素.这个方法只接受一个参数,即要创建元素的标签名.这个标签名在 ...

  8. div居中与div内容居中,不一样

    1.div自身居中 使用margin:0 auto上下为0,左右自适应的css样式. 要让div水平居中,那么除了设置css margin:0 auto外,还不能再设置float,不然将会导致div靠 ...

  9. CentOS7 安装 mysql8

    本文主要从以下几个方面对自己在centos7 下安装mysql8过程做如下总结: CentOS7 安装mysql8 步骤: window下的Navicat 连接MySql8: 涉及到的Linux命令 ...

  10. 深度点评五种常见WiFi搭建方案

    总结十年无线搭建经验,针对企业常见的五种办公室无线网络方案做个简要分析,各种方案有何优劣,又适用于那种类型的企业. 方案一:仅路由器或AP覆盖 简述:使用路由器或AP覆盖多个无线盲区,多个AP的部署实 ...