lynis
lynis copied to clipboard
Incorrect suggestion FILE-6410 (database required for 'locate' could not be found) when plocate tool is used
Describe the bug Lynis 3.0.7 show this suggestion:
- The database required for 'locate' could not be found. Run 'updatedb' or 'locate.updatedb' to create this file. [FILE-6410] https://cisofy.com/lynis/controls/FILE-6410/
But that is wrong because there is a database for 'locate' created by the tool 'plocate'. That database is the file /var/lib/plocate/plocate.db Notice that 'plocate' replaces 'mlocate' by default in Ubuntu 22.04 LTS installs. Web: https://plocate.sesse.net/
Version
- Distribution: Ubuntu 22.04 LTS
- Lynis version: 3.0.7
Expected behavior The suggestion should not be shown if there is a 'plocate' database in the system.
Output
2022-04-27 00:32:02 ====
2022-04-27 00:32:02 Performing test ID FILE-6410 (Checking Locate database)
2022-04-27 00:32:02 Test: Checking locate database
2022-04-27 00:32:02 Result: file /var/lib/mlocate/mlocate.db not found
2022-04-27 00:32:02 Result: file /var/lib/locate/locatedb not found
2022-04-27 00:32:02 Result: file /var/lib/locatedb not found
2022-04-27 00:32:02 Result: file /var/lib/slocate/slocate.db not found
2022-04-27 00:32:02 Result: file /var/cache/locate/locatedb not found
2022-04-27 00:32:02 Result: file /var/db/locate.database not found
2022-04-27 00:32:02 Result: database not found
2022-04-27 00:32:02 Suggestion: The database required for 'locate' could not be found. Run 'updatedb' or 'locate.updatedb' to create
this file. [test:FILE-6410] [details:-] [solution:-]
2022-04-27 00:32:02 ====
Possible solution
Add the check of existence of database /var/lib/plocate/plocate.db to this line of the file tests_filesystems:
LOCATE_DBS="${ROOTDIR}var/lib/mlocate/mlocate.db ${ROOTDIR}var/lib/locate/locatedb ${ROOTDIR}var/lib/locatedb ${ROOTDIR}var/lib/slocate/slocate.db ${ROOTDIR}var/cache/locate/locatedb ${ROOTDIR}var/db/locate.database"