Package: debianutils
Version: 2.20.1
Severity: normal
Tags: patch

When starting savelog with the -j option, while bzip2 in not installed, caused 
the file that was supposed to be compressed to be lost.
The lost file is overwritten because no checks are made if the compression 
succeded. 

I came across this bug in version 2.17 (etch), but since only a single 
nonrelated line changed in unstable it seemd better to file it against 2.20.1.

This could also happen for gzip, if it weren't installed.

I suggest adding a check at start of this script, as demonstrated in the 
attached patch. 
Another possible solution would be to add a verification step after compression.

Greetz,

Herman van Rink


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686-bigmem
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages debianutils depends on:
ii  coreutils                   5.97-5.3     The GNU core utilities
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  mktemp                      1.5-2        Makes unique filenames for tempora

debianutils recommends no packages.

-- no debconf information
--- savelog-2.20.1      2007-06-08 17:47:18.000000000 +0200
+++ savelog     2007-06-08 17:48:20.000000000 +0200
@@ -158,6 +158,11 @@
        exit 2
 fi

+if [ -n "$COMPRESS" ] && [ -z "`which $COMPRESS`"  ]; then
+       echo "$prog: Compression binary not available, please make sure 
'$COMPRESS' is installed" 1>&2
+       exit 2
+fi
+
 # cycle thru filenames
 while [ $# -gt 0 ]; do


Reply via email to