savelog cannot handle absolute pathname for rollover directory
Bug #129661 reported by
Roman Fiedler
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debianutils (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: debianutils
Rolldir 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
* 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
System: ubuntu feisty, patched
Changed in debianutils: | |
status: | New → Fix Released |
To post a comment you must log in.
Possible patch??
host:~/Tmp$ diff -U 3 /tmp/savelog /usr/bin/savelog
savedir= . "$savedir/ $rolldir" "$savedir/ $rolldir"
mkdir -p -- "$savedir"
--- /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
fi
- if [ "${rolldir%%/*}" = "" ] ; then
- savedir=$rolldir
- else
- savedir=
- fi
+ savedir=
if [ ! -d "$savedir" ]; then
if [ "$?" -ne 0 ]; then