Subject: | File readable check can cause loss of data |
Hi,
I've been looking into some issues I have been seeing on Windows
installations using software which relies on this module. It's worth
noting that this issue should affect all platforms.
The readable check on the previous log file in the rotate routine, when
failed, causes data loss. The log gets truncated without being rotated.
If the pre-existing log file is claimed to be not readable for some
reason by the system (Windows is really good at that), the existing log
file is lost because of this check.
If the read check fails, then the following truncation block should also
be skipped, probably with a bad return (0) from the routine, or a die.
I'm not sure of the best way to fix this? I personally would just skip
the check entirely and just leave the -f check, as the system itself
will complain if the file really isn't readable. Either that or die.
What do you think?