[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#669909: lsb-base: resetting a global variable (OPTIND) in a function, without declaring it local, can have unpleasent consequences



Package: lsb-base
Version: 4.1+Debian1
Severity: normal

start_daemon () {
    local force nice pidfile exec args
--

    OPTIND=1
--
pidofproc () {
    local pidfile base status specified pid
--

    OPTIND=1
--
killproc () {
    local pidfile sig status base name_param is_term_sig
--

    OPTIND=1
--
status_of_proc () {
    local pidfile daemon name status
--
    pidfile=
    OPTIND=1
--

as it may overwrite the calling scope's OPTIND value.


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

Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

-- no debconf information


Cheers,

-- 
Cristian



Reply to: