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 cyclic symbolic link recursion #328

Merged
merged 1 commit into from Oct 20, 2020

Conversation

sonro
Copy link
Contributor

@sonro sonro commented Oct 19, 2020

When in recursive mode: do not follow symbolic links within target directories. See #326.

  • Add check in crate::get_file_paths to only get subdirectories if
    they are not symlinks.

  • Add test with a cyclic symlink.

  • Add symlink creation function for unix and windows to use in test.

✔ Checklist:

  • This PR has been added to CHANGELOG.md (at the top of the list);
  • Tests for the changes have been added (for bug fixes / features);
  • Docs have been added / updated (for bug fixes / features).

@sonro sonro force-pushed the fix-symlink-follow branch 2 times, most recently from 2b06fae to 263cc7e Compare October 20, 2020 11:17
@codecov-io
Copy link

codecov-io commented Oct 20, 2020

Codecov Report

Merging #328 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #328   +/-   ##
=======================================
  Coverage   96.98%   96.99%           
=======================================
  Files          32       32           
  Lines        2292     2295    +3     
=======================================
+ Hits         2223     2226    +3     
  Misses         69       69           
Impacted Files Coverage Δ
src/lib.rs 98.57% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdc67d7...263cc7e. Read the comment docs.

When in recursive mode: do not follow symbolic links within target
directories. See dotenv-linter#326.

 - Add check in crate::get_file_paths to only get subdirectories if
   they are not symlinks.

 - Add test with a cyclic symlink.

 - Add symlink creation function for unix and windows to use in test.
@mgrachev mgrachev added this to the v2.2.1 milestone Oct 20, 2020
@mgrachev mgrachev linked an issue Oct 20, 2020 that may be closed by this pull request
Copy link
Member

@mgrachev mgrachev left a comment

Choose a reason for hiding this comment

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

@sonro Thank you for your contribution! 🔥

@mgrachev mgrachev merged commit 01110fa into dotenv-linter:master Oct 20, 2020
@sonro sonro deleted the fix-symlink-follow branch October 20, 2020 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Long recursion possible with cyclic links in dir tree
3 participants