logrotate does not check the syntax of the template in the configuration file.

Bug #1075690 reported by a9binh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
New
Undecided
Unassigned

Bug Description

# lsb_release -rd
Description: Ubuntu 10.04.4 LTS
Release: 10.04

# dpkg -l logrotate | grep ^ii
ii logrotate 3.7.8-4ubuntu2.2

# apt-cache policy logrotate
logrotate:
  Installed: 3.7.8-4ubuntu2.2
  Candidate: 3.7.8-4ubuntu2.2
  Version table:
 *** 3.7.8-4ubuntu2.2 0
        500 http://<apt-server>/ lucid-updates/main Packages
        500 http://<apt-server>/ubuntu/ lucid-security/main Packages
        100 /var/lib/dpkg/status
     3.7.8-4ubuntu2 0
        500 http://<apt-server>/ubuntu/ lucid/main Packages

When logrotate runs, it doesn't check the syntax of the template in the configuration file.

For example, in the configuration file /etc/logrotate.d/vsftpd,

/var/log/xferlog
        create 600 root root
        missingok
        notifempty
        rotate 4
        weekly
        compress
}

There's a missing bracket at the begining of the template. logrotate will treat the above lines as files:

/var/log/xferlog
create
600
root

What happens is that, when the weekly cron runs, it will move the directory /root into /root.1 and create a flat file /root in its place. This causes a major problem in a cluster environment.

The problem is reproducible.

The content of the status file /var/lib/logrotate/status shows:

logrotate state -- version 2
...
"/var/log/uucp.log" 2011-10-15
"600" 2012-11-2
"/var/log/btmp" 2012-11-1
...
"create" 2012-11-2
"/var/log/apache2/error.log" 2011-10-30
"/var/log/xferlog" 2012-11-4
...
"root" 2012-11-4
...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.