SUSE Support

Here When You Need Us

Permission denied when running locate command

This document (000021204) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprize Server 15

Situation

When installing the 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 denied
Directly 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

Reported to Engineering

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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.