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

Improve Linux services parsing #1049

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

JSCU-CNI
Copy link
Contributor

This PR improves Linux services parsing by switching to the configutil parser instead of using the etc plugin. We now also check if if a segment contains any configuration before attempting to parse it.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.45%. Comparing base (092e4f9) to head (c7d627d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/plugins/os/unix/linux/services.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1049      +/-   ##
==========================================
- Coverage   78.46%   78.45%   -0.01%     
==========================================
  Files         337      337              
  Lines       29698    29701       +3     
==========================================
  Hits        23303    23303              
- Misses       6395     6398       +3     
Flag Coverage Δ
unittests 78.45% <83.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.

@Horofic Horofic requested a review from Miauwkeru February 25, 2025 14:43
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.

Technically, the plugin never used the etc plugin. As it used the config_tree which was bound on / instead of /etc.

I do agree it's a lot better to just immediately use the configutil.parse instead. As it is more direct and only requires a path.

@JSCU-CNI JSCU-CNI requested a review from Miauwkeru February 25, 2025 15:33
@Miauwkeru Miauwkeru force-pushed the improvement/linux-services-parser branch from 438ace1 to 44bf86e Compare February 25, 2025 15:47
@Miauwkeru Miauwkeru force-pushed the improvement/linux-services-parser branch from 44bf86e to c7d627d Compare February 25, 2025 15:59
@Miauwkeru Miauwkeru merged commit 745d2a7 into fox-it:main Feb 25, 2025
19 of 22 checks passed
@JSCU-CNI JSCU-CNI deleted the improvement/linux-services-parser branch February 25, 2025 16:26
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.

2 participants