Bug#663351: lsb-base: pidofproc() declares unused local variable and use undeclared variable

Liu Yubao <[email protected]>
Newsgroups gmane.linux.debian.devel.lsb
Message-ID <CAO--oKj4P3B89frnsu2EZLsL6HEPYcqML5mqZz-1D9TWHy0UqA__33934.1556573801$1331394321$gmane$org@mail.gmail.com>
Package: lsb-base
Version: 3.2+Debian29
Severity: minor

Dear Maintainer,

I find there is a minor issue in pidofproc() function.

/lib/lsb/init-functions:
> pidofproc () {
>     local pidfile line status specified pid
                    ~~~~ I guess "line" should be "base".

>     pidfile=
>     specified=
>
>     OPTIND=1
>     while getopts p: opt ; do
>         case "$opt" in
>             p)  pidfile="$OPTARG"
>                 specified="specified"
>                 ;;
>         esac
>     done
>     shift $(($OPTIND - 1))
>
>     base=${1##*/}
      ~~~~~~~~~~~~~ this is will change a global variable "$base".

>     if [ ! "$specified" ]; then
>         pidfile="/var/run/$base.pid"
>     fi

Regards,
Yubao Liu

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lsb-base depends on:
ii  ncurses-bin  5.9-4
ii  sed          4.2.1-9

lsb-base recommends no packages.

lsb-base suggests no packages.

-- no debconf information
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.