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

Fix Find Errors #641

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Fix Find Errors #641

wants to merge 8 commits into from

Conversation

jabbate19
Copy link
Collaborator

What type of PR is this?

/kind bug

What this PR does / why we need it:

Fix Bug

Which issue(s) this PR fixes:

Fixes #428

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: Patch coverage is 98.65772% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 73.05%. Comparing base (533e178) to head (ca72e14).
Report is 32 commits behind head on main.

Files Patch % Lines
implants/lib/eldritch/src/file/find_impl.rs 98.65% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #641      +/-   ##
==========================================
+ Coverage   72.15%   73.05%   +0.89%     
==========================================
  Files         174      175       +1     
  Lines       11937    12342     +405     
==========================================
+ Hits         8613     9016     +403     
- Misses       3110     3111       +1     
- Partials      214      215       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jabbate19 jabbate19 requested a review from hulto February 21, 2024 03:17
}
}
Ok(out)
}

pub fn find(
pub fn find<'v>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a negative test to make sure erroring works

@jabbate19 jabbate19 requested a review from hulto February 22, 2024 19:30
@@ -35,7 +37,7 @@ fn check_path(
let metadata = path.metadata()?.permissions();
#[cfg(unix)]
{
if metadata.mode() != (permissions as u32) {
if metadata.mode() & 0o777 != (permissions as u32) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this only match on 777 perms?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Binary AND, removes the early bits so we only care about rwx. I can add back the 4th bit for SUID

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.

file.find permissions errors and unexpected behavior.
2 participants