SUSE Support

Here When You Need Us

error with logrotate that it has insecure permissions

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

Environment

SUSE Linux Enterprise Server 11 Service Pack 4
SUSE Linux Enterprise Server 11 Service Pack 2
SUSE Linux Enterprise Server 10 Service Pack 4
 

Situation

When mailman has been installed, the following message in /var/log/messages:
error: "/var/lib/mailman/logs" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.

When mysql has been installed, the following message in /var/log/messages:
error: "/var/lib/mysql" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.

When tomcat5 has been installed, the following message in /var/log/messages:
error: "/var/log/tomcat/base" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.
error: "/var/log/tomcat/base" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.

These errors can also occur with other packages.
 

Resolution

When checking the files/directories that logrotate should rotate, the rights are not root.root but something else -- e.g. for the /var/lib/mailman the user/group is mailman.mailman.
To solve the cause of the messages, add "su pkg_user pkg_group" in every section of the /etc/logrotate.d/<package> file.

As an example, there are 2 sections in /etc/logrotate.d/tomcat5.  Therefore, the "su tomcat tomcat" would need to be added to both section -- viz:
/var/log/tomcat5/base/*.txt {
    su tomcat tomcat
    notifempty
    copytruncate
    weekly
    rotate 52
    compress
    missingok
}

/var/log/tomcat5/base/catalina.out {
    su tomcat tomcat
    notifempty
    copytruncate
    weekly
    rotate 52
    compress
    missingok
}


For mailman, update each section in /etc/logrotate.d/mailman with the following:
su mailman mailman

The same for mysql.  Add the following to every section in /etc/logrotate.d/mysql :
su mysql mysql

If the messages occur for other packages, add the user/group owner of the directory or file to the appropriate file in /etc/logrotate.d/

Additional Information

Due to security issues, changes had to be made to logrotate. These changes are causing the seen behavior. The maintainer of the package is responsible for making the required changes in the logrotate configuration that belongs to his package. 
 
Also be aware that manual made changes to the logrotate configuration, can be lost with a next update of the package..
 
 
 

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:7005219
  • Creation Date: 26-Apr-2012
  • Modified Date:12-Oct-2022
    • 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.