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 xdg folder permission check for cases when privileges were dropped #4619

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Civil
Copy link

@Civil Civil commented Dec 25, 2024

If privileges for scapy were dropped, but username remain unchanged, path.exist() would trigger an exception. Fix that by moving whole if statement under try-except.

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
    Tests are not relevant because it is extremely hard to write a proper test for that behaviour.
  • I executed the regression tests (using cd test && ./run_tests or tox)
  • If the PR is still not finished, please create a Draft Pull Request

Fixes #4618

If privileges for scapy were dropped, but username remain unchanged,
path.exist() would trigger an exception. Fix that by moving whole
if statement under try-except.

Fixes secdev#4618
Copy link

codecov bot commented Dec 25, 2024

Codecov Report

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

Project coverage is 78.71%. Comparing base (cb4a95b) to head (83adf2b).

Files with missing lines Patch % Lines
scapy/main.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4619      +/-   ##
==========================================
- Coverage   81.31%   78.71%   -2.61%     
==========================================
  Files         359      334      -25     
  Lines       86047    80848    -5199     
==========================================
- Hits        69971    63641    -6330     
- Misses      16076    17207    +1131     
Files with missing lines Coverage Δ
scapy/main.py 69.13% <50.00%> (-0.87%) ⬇️

... and 280 files with indirect coverage changes

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.6.1: "Permission denied: '/home/username/.config'" on startup
1 participant