Permission denied when running locate command
This document (000021204) is provided subject to the disclaimer at the end of this document.
Environment
Situation
mlocate
package, the locate
command prints a "permission denied" message after 1 day:
sles15sp5:~ # locate someWord locate: can not open `/var/lib/mlocate/mlocate.db': Permission deniedDirectly after installing the package it worked fine
Resolution
SUSE engineering is aware of the problem and this document will be updated once a fix is available.
As workaround following command can be executed after the mlocate service has been run:
chmod o+r /var/lib/mlocate/mlocate.db
Cause
The mlocate package provides a timer which triggers the mlocate.service to run. When running the updatedb command the default umask is used to create new database file.
Within file /etc/login.defs the default umask was changed from 022 to 077 and apparmor is enforced:
aa-enforce /usr/bin/locate
Status
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021204
- Creation Date: 14-Sep-2023
- Modified Date:10-Jan-2024
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com