Android M是否不允许硬链接? [英] Is Android M not allowing hard links?

查看:147
本文介绍了Android M是否不允许硬链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序,其中包含一些C代码,该代码使用link(2)系统调用创建到现有文件的硬链接.当我在Android 5.0.2上执行该应用程序时,该应用程序的这一部分起作用.当我在Android-M设备上执行完全相同的应用程序时,link()系统调用返回-1权限被拒绝".

I have an Android app with some C code that uses the link(2) system call to create a hard link to an existing file. When I execute the app on Android 5.0.2, this part of the app works. When I execute the exact same app on an Android-M device the link() system call returns -1 "permission denied".

我注意到我的日志中收到这样的消息:

I notice in my log getting messages like this:

09-02 17:10:34.222  5291  5291 W ona.crackerjack: type=1400 audit(0.0:59): avc: denied { link } for name="fixed28" dev="mmcblk0p28" ino=82829 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=lnk_file permissive=0

此消息显示在我的应用的日志消息附近,该消息表明link()返回-1权限被拒绝",有时更早,有时更晚.

This message appears nearby my app's log message that link() returned -1 "permission denied", sometimes earlier, sometimes later.

创建硬链接是否被视为不安全?我注意到"scontext = u:r:untrusted_app".有没有一种方法可以使应用程序受信任,如果可以的话,可以使link()系统调用正常工作吗?

Is creating a hard link considered unsecure? I notice the "scontext=u:r:untrusted_app". Is there a way to make the app trusted and if so, would that let the link() system call work?

推荐答案

这似乎是设计使然".

https://code.google.com上/p/android-developer-preview/issues/detail?id = 3150 ,该项目的成员解释说:

At https://code.google.com/p/android-developer-preview/issues/detail?id=3150 , a member of the project explains that:

硬链接文件被阻止,并且对文件调用link()的尝试将返回 进阶.

Hard linking files is blocked and an attempt to call link() on a file will return EACCES.

这篇关于Android M是否不允许硬链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆