DI Roman Fiedler
Thu, 02 Aug 2007 04:22:20 -0700
Package: debianutils Version: debianutils_2.22.1.tar.gzRolldir is always used relative to the log-file to be rotated but the man page does not mention anything like that:
-r use rolldir instead of . to roll files
Fixes:
* allow absolute rolldir path
or
* block and write error message when absolute path is encountered
Output:
host:~/Tmp$ pwd
/home/fiedler/Tmp
host:~/Tmp$ savelog -r /tmp/ log
Rotated `log' at Wed Aug 1 12:26:31 CEST 2007.
host:~/Tmp$ ls -al tmp/log.0
-rw-r--r-- 1 fiedler users 0 Aug 1 12:27 tmp/log.0
Possible patch??
host:~/Tmp$ diff -U 3 /tmp/savelog /usr/bin/savelog
--- /tmp/savelog 2007-08-01 12:54:33.000000000 +0200
+++ /usr/bin/savelog 2007-03-05 06:43:41.000000000 +0100
@@ -194,11 +194,7 @@
if [ -z "$savedir" ]; then
savedir=.
fi
- if [ "${rolldir%%/*}" = "" ] ; then
- savedir=$rolldir
- else
- savedir="$savedir/$rolldir"
- fi
+ savedir="$savedir/$rolldir"
if [ ! -d "$savedir" ]; then
mkdir -p -- "$savedir"
if [ "$?" -ne 0 ]; then
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]