Package: keychain
Version: 2.5.5-5
Severity: normal

The stanza near line 480 (search for "defunct") uses IGNORECASE, which is a
gawk extension.  Additionally, this gawk extension is disabled if
POSIXLY_CORRECT is set[0], which AIUI it is in newer versions of bash when
invoked as /bin/sh.

As a consequence, the match is not case-insensitive unless gawk is used and
POSIX mode is disabled.  Therefore, you should either find some other way of
removing that text (recommendation below) or Depend: gawk, use gawk instead of
awk when invoking the program, and unset POSIXLY_CORRECT in the script.  If you
choose the latter option, please upgrade this bug to severity serious, since the
dependencies are incorrectly specified.

I have created a testcase (test.sh) which I have attached.  It should be invoked
as ./test.sh, which will test this behavior with different combinations of the
following parameters:
* Uppercase/lowercase text as input to awk.
* Uppercase/lowercase text as match for awk.
* Setting/not setting IGNORECASE=1.
* mawk/gawk.
* Setting/not setting both POSIXLY_CORRECT=1 and _POSIX2_VERSION=200112.

Additionally, if you set FORCE_CASE=1 when invoking test.sh, IGNORECASE=1 will
never be set.  Only in this case will the test succeed.

My recommendation is to remove the IGNORECASE=1 stanza and instead use the
following construction:

grep -vi 'defunct'

Thank you for your time.

[0] strings `which gawk` | grep -E '(POSIXLY_CORRECT|_POSIX2_VERSION)'

-- System Information:
Debian Release: testing/unstable
  APT prefers experimental
  APT policy: (500, 'experimental'), (500, 'unstable'), (500, 'testing'), (500, 
'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-k7
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)

Versions of packages keychain depends on:
ii  debconf [debconf-2.0]        1.5.0       Debian configuration management sy
ii  grep                         2.5.1.ds2-4 GNU grep, egrep and fgrep
ii  openssh-client [ssh-client]  1:4.2p1-8   Secure shell client, an rlogin/rsh

keychain recommends no packages.

-- no debconf information

Attachment: test.sh
Description: application/awk

Reply via email to