-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose landlock API #11
Conversation
fa11ecc
to
08972b7
Compare
3acdf72
to
e060492
Compare
4fecf16
to
a6b718f
Compare
3aee5fa
to
f288785
Compare
Made it working with the Had to use the v2 ABI otherwise we get into these kinds of issues due to the absence of
|
Two things to do before tagging as ready for review:
|
I currently don't have any examples of it, but it worked for me by manually adding the submodule in |
041e497
to
21db054
Compare
The module not found behavior is observed by pylance and pyright, but I confirmed that the module is actually in sys.module. |
I have added a simple unit test that only runs on supported platforms (Linux x86-64). There is only one test because pytest runs all the test under the same process so calling |
To solve that, we can add a
yeah, for separation a multiprocessing.Process or something alike is needed. |
I leave that to you, this is alien to me.
Do you think it's worth doing it ? I'd say the |
127c729
to
03889ce
Compare
03630c7
to
cb1eb89
Compare
@vlaci do you see anything blocking the merge of this PR ? Otherwise I'll approve it. |
Looks fine by me |
This code makes it possible to import math as a Python submodule. Extension modules are not packages, so their submodules are not affected by the usual rules from import machinery.
The default output doesn't contain enough information to diagnose issues.
Landlock is a kernel API for unprivileged access control. We take advantage of it to limit where unblob can write to and read from on the filesystem. This is a Linux-only feature that won't be enabled on OSX. For more information, see https://docs.kernel.org/userspace-api/landlock.html We use Landlock ABI version 2 since it introduced the LANDLOCK_ACCESS_FS_REFER permission that's required to create hardlinks. Co-authored-by: Quentin Kaiser <quentin.kaiser@onekey.com>
There is also a
landlock
package on PyPI implementing this, however I already implemented it by the time I found it