This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients lars.gustaebel, serhiy.storchaka, xdegaye
Date 2017-01-07.21:41:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483825282.92.0.0513800761995.issue29181@psf.upfronthosting.co.za>
In-reply-to
Content
> Why os.link() is failed? If hard links are not supported on Android, shouldn't os.link be not implemented?

Android has a restrictive security model based on SELinux [1].

With the Android adb shell on the emulator at API level 24:

$ >foo
$ ln foo bar
ln: cannot create hard link from 'foo' to 'bar': Permission denied
$ su
# ln foo bar
# ls -li foo bar
15688 -rw-rw-rw- 2 shell shell 0 2017-01-07 22:29 bar
15688 -rw-rw-rw- 2 shell shell 0 2017-01-07 22:29 foo

Here is the Android commit message that does not grant hard link capabilities by default:
https://android.googlesource.com/platform/external/sepolicy/+/85ce2c7

[1] https://source.android.com/security/selinux/
History
Date User Action Args
2017-01-07 21:41:22xdegayesetrecipients: + xdegaye, lars.gustaebel, serhiy.storchaka
2017-01-07 21:41:22xdegayesetmessageid: <1483825282.92.0.0513800761995.issue29181@psf.upfronthosting.co.za>
2017-01-07 21:41:22xdegayelinkissue29181 messages
2017-01-07 21:41:22xdegayecreate