zoukankan      html  css  js  c++  java
  • 修改sepolicy后编译出现‘Error while expanding policy’【转】

    本文转载自: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 };

  • 相关阅读:
    理解闭包Closure
    理解商集
    理解格
    理解距(数学)
    微积分英文词汇,高数名词中英文对照,高等数学术语英语翻译一览
    对Extjs中store的多种操作
    mysql中的除法取整
    【python】用asq实现count(distinct cln)
    Timer 和TimerTask的使用
    使用vim.rc配置vim
  • 原文地址:https://www.cnblogs.com/zzb-Dream-90Time/p/10121617.html
Copyright © 2011-2022 走看看