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 issue with pathless config items #785

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

Conversation

cecinestpasunepipe
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.55%. Comparing base (03d19e6) to head (3d6125a).

Files Patch % Lines
dissect/target/plugins/os/unix/etc/etc.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #785      +/-   ##
==========================================
- Coverage   75.56%   75.55%   -0.01%     
==========================================
  Files         299      299              
  Lines       25782    25784       +2     
==========================================
+ Hits        19481    19482       +1     
- Misses       6301     6302       +1     
Flag Coverage Δ
unittests 75.55% <33.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

dissect/target/plugins/os/unix/etc/etc.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/etc/etc.py Outdated Show resolved Hide resolved
@Miauwkeru
Copy link
Contributor

alternatively you can just pass config_object.entry.path to self._sub in def etc

dissect/target/plugins/os/unix/etc/etc.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/etc/etc.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Miauwkeru Miauwkeru left a comment

Choose a reason for hiding this comment

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

I would also first rebase and fix the conflicts.


if isinstance(config_object, ConfigurationEntry):
path = Path(entry) / Path(item)
yield from self._sub(config_object, path, orig_path=path, pattern=pattern)
Copy link
Contributor

Choose a reason for hiding this comment

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

orig_path will not contain the root. aka, /etc. I think it might be a good idea to add that to it.

Comment on lines 73 to +76
config_object = self.get(str(Path(entry) / Path(item)))
yield from self._sub(config_object, Path(entry) / Path(item), pattern)

if isinstance(config_object, ConfigurationEntry):
path = Path(entry) / Path(item)
Copy link
Contributor

Choose a reason for hiding this comment

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

path = Path(entry) / item
config_object = self.get(str(path))

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