如何在安装Selinux策略时处理错误
现在,我正在尝试安装我制定的Selinux政策。 但是我遇到了如下:
无法解决filecon语句在/var/lib/selinux/targeted/tmp/tmp/tocules/400/mypolicy/cil:303 半模型:失败! 安装失败:
我希望知道如何处理此错误。如何在.te或.fc文件中找到错误点? 数字“ 303”是什么意思?是行号吗?但是CIL文件是二进制文件。 您能让我知道一种处理此错误的方法吗?
谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的
.te
.if
和.fc
文件中的转换是一个多步骤过程。当系统构建策略模块时,首先,CheckModule用于构建.mod中间文件。接下来,称为semodule_package,将此中间文件和相应的文件 - 封闭文件转换为.pp文件。
在您的错误中,
semodule
现在在策略软件包中抱怨一些问题,并给出了相应的常见中间语言行号作为参考。如果您想了解更多有关CIL的信息,请参阅此处:在CIL文件中获取失败线,找到您的PP文件并调用PP编译器以获取CIL代码。 PP编译器位于名为HLL的高级语言基础架构文件夹中(请参阅)。
现在,您可以在mypolicy.txt中检查给定的行号。
The transformation of your
.te
.if
and.fc
files into the actual policy is a multi-step process.When the system builds a policy module, first, checkmodule is used to construct a .mod intermediate file. Next, semodule_package is called, transforming this intermediate file and the corresponding file-context file into a .pp file.
In your error,
semodule
now complains about some problem in the policy package and gives the corresponding Common Intermediate Language line number as a reference. If you want to know more about CIL, see here: https://github.com/SELinuxProject/selinux/blob/master/secilc/docs/README.mdTo get the failing line within the CIL file, locate your pp file and call the pp compiler to get the CIL code. The pp compiler is in the High-Level Language Infrastructure folder called hll (see https://github.com/SELinuxProject/selinux/wiki/High-Level-Language-Infrastructure).
Now you can check the given line number in the mypolicy.txt.
我找到了一个原因。
在RH8中,将UMASK添加到/ETC/PAM.D/PostLogin中。因此,对于sftp,拉动了/etc/login.defs中的umask值,并将其应用于sftp的umask值。是077
。
I found a reason.
In RH8, umask is added to /etc/pam.d/postlogin. So, for sFtp, the UMASK value in /etc/login.defs is pulled and it is applied to umask value for sFtp. It was 077.
Redhat link