-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
Add -o/--owner to filter files by owner and/or group #581
Conversation
src/app.rs
Outdated
.long_help( | ||
"Filter files by their user and/or group. \ | ||
Format: [(user|uid)][:(group|gid)]. Either side is optional. \ | ||
Precede either side with a ! to exclude files instead.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: …either side with a '!' to exclude…
Specifying the full format is great, but a few examples would make things even easier to understand, I think. Maybe:
Examples:
--owner john
--owner :students
--owner '!john:students'
Thank you very much for this contribution! The code looks great.
It would be great, but we can also add this at a later stage. Multiple A few questions / comments:
|
Yes, it should work by OR-ing, and negations should work by AND-ing, which i think would make sense when seen in examples, but may not be intuitive to everyone.
Unfortunately no, I didn't dig very far, since I can only properly try it out on linux systems. Finding a cross-platform way to do this would be interesting however. I imagine that it could also account for more interesting setups, such as LDAP/ActiveDirectory/whatever-the-equivalent-on-OSX is. But I'm not familiar enough with windows to propose solutions that look idiomatic on the platform.
Integration tests would certainly be interesting. I guess setting up a docker image with known users/groups and IDs would be sufficient. It looks like travis can speak docker.
Sure
Ok, I did not realize more docs existed 😄. I will update them. |
…trings with more than one ':'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the updates!
That sounds rather involved. Let's try without an integration test for now. |
Closes #307
This implements a single constraint.
Implementation is unix-specific for now.
It can easily be extended to cover redox, but I think it needs some testing first: theusers
crate makes no mention of redox support, and there is also redox_usersPossible questions:
--owner
arguments (like with time_constraints)Edit: it seems redox uses the unix
target_family
as of rust-lang/rust#60139, so no special handling is needed.