Package: debianutils
Version: 2.11.2
Severity: normal
File: /usr/bin/savelog
Tags: patch


Sorry, I noticed this one after the hyphen one.

A filename like "foo bar" causes an error like:
/usr/bin/savelog: line 177: [: foo: binary operator expected
in all cases, and breaks the -n and -d options.

Patch attached.


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.10-grsec
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages debianutils depends on:
ii  coreutils                   5.2.1-2      The GNU core utilities
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information
--- savelog.orig        2005-02-13 18:08:18.000000000 -0800
+++ savelog     2005-02-13 18:08:18.000000000 -0800
@@ -174,7 +174,7 @@
 
        # if not a file or empty, do nothing major
        # (in the Debian version, we rotate even if empty by default)
-       if [ ! -s $filename ] && [ "$rotateifempty" != "yes" ]; then
+       if [ ! -s "$filename" ] && [ "$rotateifempty" != "yes" ]; then
                # if -t was given and it does not exist, create it
                if test -n "$touch" && [ ! -f "$filename" ]; then 
                        touch -- "$filename"
@@ -249,7 +249,7 @@
 
        # compress the old uncompressed log if needed
        if test -n "$datum" && test -n "$COMPRESS"; then
-               $COMPRESS -- $newname.[0-9]*[0-9]
+               $COMPRESS -- "$newname".[0-9]*[0-9]
        fi
 
        # remove old files if so desired
@@ -292,7 +292,7 @@
        [ ! -f "$newname.0" ] && touch -- "$newname.0"
        fixfile "$newname.0"
        if [ -n "$datum" ]; then
-               mv -- $newname.0 $newname.$DATUM
+               mv -- "$newname.0" "$newname.$DATUM"
        fi
 
        # report successful rotation

Reply via email to