Red Hat Bugzilla – Bug 13122
Space in log file name.
Last modified: 2008-05-01 11:37:56 EDT
Logrotate does not work
with log files containing special
symbols (like space) in filename.
The easiest wy to fix logrotate
is to use
URLEcoded format for file names.
You can just use two
C functions which do same thing as
escape and unescape
from perl module /usr/lib/perl5/5.00503/CGI.pm.
when you save to /var/lib/logrotate.status
escape file name by using a function
equivalent to CGI::escape
and after you read the string from the file
use a function equivalent to CGI::unescape.
This way you will fix all the problems
with file names containing special symbols in logrotate.
The mentioned functions escape and unescape
are standard and may be found in many reference
I recommend to name them
like logrotate_escape and logrotate_unescape
to avoid possible clashes with functions from C library.
Also the proposed solution is better
than the patch posted in
because it also hanles symbols like \n \r and etc.
Mentioned patch seems to fail on log
files with \n symbols.
Proposed solution is OK with any special symbols.
fixed in logrotate-3.4