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

Prevent infinite loops during symlink traversal #9748

Merged

Commits on Apr 29, 2021

  1. Prevent infinite loops during symlink traversal

    rubocop#8815 introduced a traversal
    strategy that used recursion.
    rubocop#9703 then fixed an issue with
    this traversal which accounted for directories and symlinks.
    
    When a symlink points to a parent directory that contains that symlink
    it'll cause this to go into a loop until the filename is too long for
    glob to handle.
    
    We prevent this by checking for the inclusion of a symlink's real path
    in the base directory's realpath. If the base directory's path starts
    with the symlink's destination then we are in a loop and should skip
    processing the directory
    Tonkpils committed Apr 29, 2021
    Copy the full SHA
    f99a054 View commit details
    Browse the repository at this point in the history