Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

fix: lynis testDB path #886

Merged
merged 1 commit into from
Nov 2, 2023
Merged

fix: lynis testDB path #886

merged 1 commit into from
Nov 2, 2023

Commits on Nov 2, 2023

  1. fix: lynis testDB path

    The `lynis show dbdir` command returns the path to the test database
    directory on the where the output string has a trailing newline
    character which is not removed before generating the path for the
    `tests.db` file. This results a bogus file path liek
    `/usr/local/lynis/db /tests.db` and triggers an error as the `tests.db`
    file is not accessable.
    
    This fix make sure that the command output is sanitized by removing
    leading/trailing whitespaces and the path is cleaned before using it to
    assemble the file path for `tests.db`.
    
    Switch to `filepath` from `path` for working with filesystem paths
    as the latter is not meant to be used with OS filesystem paths.
    
    Also rename `testdb` variable to `testDB` in order to make it aligned
    with Go naming convention.
    chrisgacsal committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    8a5ff2f View commit details
    Browse the repository at this point in the history