Package: launchtool
Version: 0.7-1
Severity: important
Tags: patch

The program does not check properly if another instance of launchtool
with the same tag is already started. This is due to an error in the
code, there is an "if" against a not-always-initialized variable.

On line 769 of src/launchtool.cc you find

    if (!op_no_pidfile && pidfile.is_active())

but op_no_pidfile is initialized (by libpopt) only when it is used and
to value 1. Given that the default is "-1" the expression !op_no_pidfile
is always false, which prevent to evaluate if other launchtools with
same tag are running.

To resolve just apply the attached diff to launchtool.cc

Beware that changing the default of op_no_pidfile is not feasible
because of the way GETBOOL works.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages launchtool depends on:
ii  libc6                         2.3.5-7    GNU C Library: Shared libraries an
ii  libgcc1                       1:4.0.2-3  GCC support library
ii  libpopt0                      1.7-5      lib for parsing cmdline parameters
ii  libstdc++5                    1:3.3.6-10 The GNU Standard C++ Library v3

launchtool recommends no packages.

-- no debconf information
-- 
Daniele                 JID: [EMAIL PROTECTED] (http://www.jabber.org)
and remember: respect is everything . . . . . . . . . . . free your mind
769c769,770
<               if (!op_no_pidfile && pidfile.is_active())
---
>         //op_no_pidfile == -1 if --no-pidfile not specified
>               if (op_no_pidfile == -1 && pidfile.is_active())

Reply via email to