gpt4 book ai didi

python - 无法运行位于android源代码中的audit2allow

转载 作者:行者123 更新时间:2023-12-05 06:34:42 26 4
gpt4 key购买 nike

audit2allow python 脚本的位置是external/selinux/prebuilts/bin/audit2allow

当我尝试运行脚本时,出现以下错误:

Traceback (most recent call last):
File "/home/shobhit/Desktop/Code/aosp/msm8909_android/external/selinux/policycoreutils/audit2allow/audit2allow", line 24, in <module>
import sepolgen.audit as audit
File "/home/shobhit/Desktop/Code/aosp/msm8909_android/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages/sepolgen/audit.py", line 20, in <module>
import refpolicy
File "/home/shobhit/Desktop/Code/aosp/msm8909_android/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages/sepolgen/refpolicy.py", line 22, in <module>
import selinux
File "/home/shobhit/Desktop/Code/aosp/msm8909_android/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages/selinux/__init__.py", line 28, in <module>
_selinux = swig_import_helper()
File "/home/shobhit/Desktop/Code/aosp/msm8909_android/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages/selinux/__init__.py", line 24, in swig_import_helper
_mod = imp.load_module('_selinux', fp, pathname, description)
ImportError: /home/shobhit/Desktop/Code/aosp/msm8909_android/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages/selinux/_selinux.so: undefined symbol: selabel_partial_match

最佳答案

我知道这是一个老问题,但是......

是我机器上的 python 版本问题。将 python 链接更改为指向 python2 而不是 python3 并且一切正常。也许有比(临时)更改链接更优雅的解决方案,但它确实有效。

关于python - 无法运行位于android源代码中的audit2allow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50148270/

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