savelog cannot handle absolute pathname for rollover directory

Bug #129661 reported by Roman Fiedler
2
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

Revision history for this message
Roman Fiedler (roman-fiedler-deactivatedaccount) wrote :

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

Daniel T Chen (crimsun)
Changed in debianutils:
status: New → Fix Released
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.