Skip to content
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

libselinux and SELinux support for coreutils #21495

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

kyufie
Copy link
Contributor

@kyufie kyufie commented Sep 17, 2024

This PR introduces a new library (libandroid-selinux) for basic SELinux functionality.
Along with that, I've also added SELinux support to coreutils.
chcon and ls -Z seems to be working.
I still haven't done a thorough testing just yet so it might still have a few catch, but that should not break existing functionalities.

@kyufie
Copy link
Contributor Author

kyufie commented Sep 19, 2024

The added SELinux feature seems to be working just fine except for the ability to set default context type, but that's expected considering the library itself have the feature disabled when built for Android.
The non-SELinux related operations seems unaffected by this change.

Here's the list of the progams I've tested:

  • chcon
  • copy
  • copy
  • id
  • install
  • ls
  • mkdir
  • mkfifo
  • mknod
  • runcon
  • stat

Copy link
Contributor

@truboxl truboxl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok LGTM I will help merge unless someone objects

@kyufie
Copy link
Contributor Author

kyufie commented Sep 26, 2024

Many thanks.

@truboxl
Copy link
Contributor

truboxl commented Sep 27, 2024

I do have concern though whether some build systems are stupidly enough to hardcode detect libselinux.so.1 and porting become a hassle later on (many patches).

Should be rectified somewhat using modified pc.in files which can be added later. And in the worst scenario can change the soname back which should be done as early as possible.

Not to say I don't like libandroid-selinux since it can avoid conflict with system libselinux and we got a few instances of that case in the past. I will merge in as is in a few hours.

@truboxl truboxl merged commit 4391b0a into termux:master Sep 27, 2024
7 checks passed
@truboxl
Copy link
Contributor

truboxl commented Sep 27, 2024

Thanks for the hard work!

@kyufie kyufie deleted the libandroid-selinux branch September 28, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants