Package: amanda-common
Version: 1:2.5.2p1-1
Severity: normal
File: /usr/sbin/amstatus
Tags: patch

amstatus contains an error in it's error output for non-existing
configurations.


How to reproduce:
-----------------
Assuming that /etc/amanda/whatever does not exist
    # amstatus whatever
    Argument "whatever" isn't numeric in division (/) at /usr/sbin/amstatus 
line 75.
    Argument "/etc/amanda" isn't numeric in division (/) at /usr/sbin/amstatus 
line 75.
    Illegal division by zero at /usr/sbin/amstatus line 75.


The error:
----------
Line 75:
    print "Configuration directory '" . $confdir/$conf . "' doesn't exist\n";

This is a division of $confdir and $conf, but that's not what
was wanted.  (The same error is on line 79.)


Fix:
-------
"$confdir/$conf" is trusted in the rest of the program, so we
can simply fold them back into the doublequote:


--- amstatus.old        2008-03-16 21:47:14.000000000 +0100
+++ amstatus    2008-03-16 21:50:25.000000000 +0100
@@ -72,11 +72,11 @@
 
 
 if ( ! -e "$confdir/$conf" ) {
-    print "Configuration directory '" . $confdir/$conf . "' doesn't exist\n";
+    print "Configuration directory '$confdir/$conf' doesn't exist\n";
     exit 1;
 }
 if ( ! -d "$confdir/$conf" ) {
-    print "Configuration directory '" . $confdir/$conf . "' is not a 
directory\n";
+    print "Configuration directory '$confdir/$conf' is not a directory\n";
     exit 1;
 }
 



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages amanda-common depends on:
ii  adduser            3.106                 add and remove users and groups
ii  bsd-mailx [mailx]  8.1.2-0.20071201cvs-2 A simple mail user agent
ii  debconf [debconf-2 1.5.20                Debian configuration management sy
ii  libc6              2.7-9                 GNU C Library: Shared libraries
ii  libncurses5        5.6+20080203-1        Shared libraries for terminal hand
ii  libreadline5       5.2-3                 GNU readline and history libraries
ii  mailx              1:20071201-2          Transitional package for mailx ren
ii  openbsd-inetd [ine 0.20050402-6          The OpenBSD Internet Superserver
ii  perl [perl5]       5.8.8-12              Larry Wall's Practical Extraction 
ii  tar                1.19-2                GNU version of the tar archiving u
ii  update-inetd       4.30                  inetd configuration file updater

amanda-common recommends no packages.

-- debconf information:
  amanda-common/merge_amandates:



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to