我像这样使用SELinux:
SELinux.restoreconRecursive(new File("/data/data/com.my.app"));我得到了这个失败:
07-27 19:21:11.890 W/SELinux ( 5182): SELinux: Could not look up information for package com.my.app, cannot restorecon .
07-27 19:21:11.890 E/SELinux ( 5182): SELinux: Could not set context for /data/data/com.my.app: Socket operation on non-socket
07-27 19:21:11.890 E/SELinux ( 5182): SELinux: Could not read /data/data/com.my.app: Permission denied. drwxrwx--x u0_a126 u0_a126 u:object_r:app_data_file:s0 cachedrwxrwx--x u0_a126 u0_a126 u:object_r:app_data_file:s0:c512,c768 cache这就是在我的代码中使用restorecon的原因。请帮我解释一下这个例外。
发布于 2016-07-28 14:49:50
我已经解决了这个问题。因为另一个SELinux权限:
allow backuprestore selinuxfs:file { write };
allow backuprestore kernel:security { check_context };
allow backuprestore app_data_file:dir { relabelfrom relabelto};
allow backuprestore app_data_file:file { relabelfrom relabelto};https://stackoverflow.com/questions/38611850
复制相似问题