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

configuration: fix incorrect handling of relative executables #419

Merged
merged 1 commit into from
Mar 11, 2024

Commits on Mar 10, 2024

  1. configuration: fix handling relative executables

    Commit 720eb98 (configuration: refactorize code scanning for
    executables) introduced a bug when the executable is a relative path.
    In this case the file is always expanded, thus causing file to be always
    considered non executable by the code scanning through the parameters
    in configuration.cc.
    
    Update the look_path function to first try a file without consulting
    the PATH environment variable.
    
    Add the find_executable function, and update the code to check the file
    is not a directory instead of checking if it is a regular file, so that
    symlinks are handled correctly.
    
    Update the peek_file function to do the same, so that ParseManager can
    handle symlinks correctly.
    
    The old code worked because the last argument (before the executable
    arguments) was update correctly thanks to the loop over the PATH
    environment variable.
    
    Note that the correct solution is to add "--" before the executable
    arguments, but this will break the kcov cli interface.
    perillo committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    b587483 View commit details
    Browse the repository at this point in the history