-
Notifications
You must be signed in to change notification settings - Fork 56
Implement -context
#540
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
base: main
Are you sure you want to change the base?
Implement -context
#540
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #540 +/- ##
==========================================
- Coverage 87.69% 86.53% -1.17%
==========================================
Files 31 32 +1
Lines 6893 6987 +94
Branches 324 340 +16
==========================================
+ Hits 6045 6046 +1
- Misses 617 710 +93
Partials 231 231 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
908a6ac
to
8006d1d
Compare
looks like you missed my comment here: #375 (comment) :( |
https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/features/selinux.rs i have been working on this and to use it on findutils also, there is that crate https://codeberg.org/koutheir/selinux |
@sylvestre I feel so sorry that GitHub doesn't seem to have pushed this comment to me correctly🥺, I didn't realize you had done some work on it and I didn't deliberately ignore your efforts. |
I noticed the crate as well, but I personally don't think we should try to use more c bindings in findutils, it might be more appropriate to use more pure Rust code. What do you think? |
Short answer: either (1) use the Looking at the code, I see multiple hard-coded paths, constants, and logic, all relative to the current implementation details of SELinux; details that could change anytime in subtle ways that could break this Rust implementation. It seems like bad design to me to have that non-trivial amount of logic inside this program. In my opinion, that logic belongs inside a dedicated crate that abstracts it away from this program. Now of course, I prefer that logic to be written in Rust too, but for the moment, such a crate doesn't exist, as far as I know. The closest thing to it is a Rust crate ( Full disclosure: I'm the maintainer of the |
1527504
to
d4e084f
Compare
Closes #375
To avoid using C bindings, I wrote the detection logic for SELinux in Rust by referring to libselinux, and used
xattr
crate to capture the SELinux extension for matching during the matching stage.xattr
only supported on unix platforms so it was marked as[target.'cfg(target_os = "linux")'.dependencies]
.I'm still looking for a suitable way to write the test.