-
Notifications
You must be signed in to change notification settings - Fork 79
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
Possible glob incompatibility with original sudo #834
Comments
Here's my take, also taking into account the criteria for inclusion.
So I would say, if this needs addressing, it needs addressing for everybody, and the glob crate is the place to do it. I do think that supporting both |
I agree with your assessment and I'll try to put up a PR for |
There seem to be some other subtle differences documented by
Some of these will not be very important. The third point for example seems fine if the use glob::Pattern;
fn main() {
let p = Pattern::new("[.abc]foo.txt").unwrap();
let r = p.matches(".foo.txt");
println!("Case 2: Class should not match leading `.`: {}", !r);
let p = Pattern::new("[.txt");
println!("Case 3: Unmatched [ is allowed: {}", p.is_ok());
let p = Pattern::new("foo/bar.txt").unwrap();
let r = p.matches("foo//bar.txt");
println!("Case 4: Different number of slashes should not match: {}", !r);
} This prints:
This means that Edit: |
Describe the bug
Reading your recent blog post regarding dependencies, I learned that
sudo-rs
depends onglob
. I figured that you might have a similar problem as uutils with this crate. In particular, we once opened this issue: rust-lang/glob#116.To recap that issue:
glob
only allows[!...]
for negation of character classes, but not[^...]
. The standardfnmatch
andglob
functions usually do allow^
to be used, including the implementation bysudo
, even though it does not seem to be documented.I checked
src/sudoers/tokens.rs
and could not find a mitigation for this there. There also aren't any occurrences of'^'
in the code base according to GitHub search, which I would expect to see if you implemented a workaround for this issue.I'm not sure how big of an issue this is, but it's probably at least an incompatibility that should be documented. I'm also not really sure how to create a test case for this, but if you can point me to documentation for that, I'd be happy to try to create one.
The text was updated successfully, but these errors were encountered: