Your message dated Wed, 25 Mar 2020 12:28:13 -0700
with message-id <20200325192813.ga3...@t570.nardis.ca>
and subject line Re: Several uses of XSI:isms and bashisms
has caused the Debian Bug report #256289,
regarding Several uses of XSI:isms and bashisms
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
256289: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256289
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: openldap2
Version: 2.1.30-1
Severity: minor
Tags: patch

Several scripts in openldap2 contains XSI:isms (such as `-a' and `-o',
and the use of `trap' with numerical signals, instead of signalnames),
and bashisms (local).  Also egrep is used instead of the grep -E which
is what POSIX recommends.  The included patch fixes these issues.

Rationale:

policy 10.4
http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html
http://www.opengroup.org/onlinepubs/009695399/utilities/grep.html
http://www.opengroup.org/onlinepubs/009695399/utilities/test.html


Regards: David Weinehall

diff -ur openldap2-2.1.30-old/build/mkdep openldap2-2.1.30/build/mkdep
--- openldap2-2.1.30-old/build/mkdep    2003-03-03 19:10:01.000000000 +0200
+++ openldap2-2.1.30/build/mkdep        2004-06-25 22:06:05.000000000 +0300
@@ -97,7 +97,7 @@
 
 TMP=/tmp/mkdep$$
 
-trap 'rm -f $TMP.sed $TMP ; exit 1' 1 2 3 13 15
+trap 'rm -f $TMP.sed $TMP ; exit 1' HUP INT QUIT PIPE TERM
 
 cp $MAKE ${MAKE}.bak
 
@@ -153,7 +153,7 @@
        esac
 done
 for i in $FILES; do
-       $MKDEP_CC $MKDEP_CFLAGS $FLAGS $i | egrep '^#.*"' > $TMP.sed
+       $MKDEP_CC $MKDEP_CFLAGS $FLAGS $i | grep -E '^#.*"' > $TMP.sed
 awk '
 BEGIN {
        file = "'$i'"
diff -ur openldap2-2.1.30-old/build/shtool openldap2-2.1.30/build/shtool
--- openldap2-2.1.30-old/build/shtool   2002-12-30 06:07:57.000000000 +0200
+++ openldap2-2.1.30/build/shtool       2004-06-25 22:10:23.000000000 +0300
@@ -70,7 +70,7 @@
     echo "$0:Hint:  run \`$0 -h' for usage" 1>&2
     exit 1
 fi
-if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
+if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
     echo "This is GNU shtool, version 1.6.2 (02-Nov-2002)"
     echo "Copyright (c) 1994-2002 Ralf S. Engelschall <r...@engelschall.com>"
     echo "Report bugs to <bug-sht...@gnu.org>"
@@ -135,15 +135,15 @@
     echo ''
     exit 0
 fi
-if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
+if [ ".$1" = ".-v" ] || [ ".$1" = ."--version" ]; then
     echo "GNU shtool 1.6.2 (02-Nov-2002)"
     exit 0
 fi
-if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then
+if [ ".$1" = ".-r" ] || [ ".$1" = ."--recreate" ]; then
     shtoolize -obuild/shtool echo move install mkdir mkln subst
     exit 0
 fi
-if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
+if [ ".$1" = ".-d" ] || [ ".$1" = ."--debug" ]; then
     shift
     set -x
 fi
@@ -342,8 +342,8 @@
 
     #   determine whether option needs an argument
     eval "opt_MODE=\$opt_MODE_${opt_OPT}"
-    if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then
-        if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then
+    if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then
+        if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then
             opt_PREV="$opt_OPT"
             continue
         fi
@@ -450,7 +450,7 @@
     #   determine terminal bold sequence
     term_bold=''
     term_norm=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%[Bb]'`" != . ]; then
         case $TERM in
             #   for the most important terminal types we directly know the 
sequences
             xterm|xterm*|vt220|vt220*)
@@ -486,13 +486,13 @@
                             break
                         fi
                     done
-                    if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
+                    if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then
                         break;
                     fi
                 done
                 ;;
         esac
-        if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
+        if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then
             echo "$msgprefix:Warning: unable to determine terminal sequence 
for bold mode" 1>&2
             term_bold=''
             term_norm=''
@@ -501,7 +501,7 @@
     
     #   determine user name
     username=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%[uUgG]'`" != . ]; 
then
         username="$LOGNAME"
         if [ ".$username" = . ]; then
             username="$USER"
@@ -521,7 +521,7 @@
     
     #   determine user id
     userid=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%U'`" != . ]; then
         userid="`(id -u) 2>/dev/null`"
         if [ ".$userid" = . ]; then
             str="`(id) 2>/dev/null`"
@@ -529,11 +529,11 @@
                 userid=`echo $str | sed -e 's/^uid[    ]*=[    ]*//' -e 
's/(.*//'`
             fi
             if [ ".$userid" = . ]; then
-                userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+                userid=`grep -E "^${username}:" /etc/passwd 2>/dev/null | \
                         sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                 if [ ".$userid" = . ]; then
                     userid=`(ypcat passwd) 2>/dev/null |
-                            egrep "^${username}:" | \
+                            grep -E "^${username}:" | \
                             sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                     if [ ".$userid" = . ]; then
                         userid='?'
@@ -545,11 +545,11 @@
     
     #   determine (primary) group id
     groupid=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then
-        groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%[gG]'`" != . ]; then
+        groupid=`grep -E "^${username}:" /etc/passwd 2>/dev/null | \
                  sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
         if [ ".$groupid" = . ]; then
-            groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
+            groupid=`(ypcat passwd) 2>/dev/null | grep -E "^${username}:" | \
                      sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
             if [ ".$groupid" = . ]; then
                 groupid='?'
@@ -559,12 +559,12 @@
     
     #   determine (primary) group name
     groupname=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then
-        groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%g'`" != . ]; then
+        groupname=`grep -E "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | 
\
                    sed -e 's/:.*$//'`
         if [ ".$groupname" = . ]; then
             groupname=`(ypcat group) 2>/dev/null | \
-                       egrep "^[^:]*:[^:]*:${groupid}:" | \
+                       grep -E "^[^:]*:[^:]*:${groupid}:" | \
                        sed -e 's/:.*$//'`
             if [ ".$groupname" = . ]; then
                 groupname='?'
@@ -575,7 +575,7 @@
     #   determine host and domain name
     hostname=''
     domainname=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%h'`" != . ]; then
         hostname="`(uname -n) 2>/dev/null |\
                    awk '{ printf("%s", $1); }'`"
         if [ ".$hostname" = . ]; then
@@ -592,16 +592,16 @@
                 ;;
         esac
     fi
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%d'`" != . ]; then
         if [ ".$domainname" = . ]; then
             if [ -f /etc/resolv.conf ]; then
-                domainname="`egrep '^[         ]*domain' /etc/resolv.conf | 
sed -e 'q' |\
+                domainname="`grep -E '^[       ]*domain' /etc/resolv.conf | 
sed -e 'q' |\
                              sed -e 's/.*domain//' \
                                  -e 's/^[      ]*//' -e 's/^ *//' -e 's/^      
*//' \
                                  -e 's/^\.//' -e 's/^/./' |\
                              awk '{ printf("%s", $1); }'`"
                 if [ ".$domainname" = . ]; then
-                    domainname="`egrep '^[     ]*search' /etc/resolv.conf | 
sed -e 'q' |\
+                    domainname="`grep -E '^[   ]*search' /etc/resolv.conf | 
sed -e 'q' |\
                                  sed -e 's/.*search//' \
                                      -e 's/^[  ]*//' -e 's/^ *//' -e 's/^      
*//' \
                                      -e 's/ .*//' -e 's/       .*//' \
@@ -617,7 +617,7 @@
     time_month=''
     time_year=''
     time_monthname=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then
+    if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep -E '%[DMYm]'`" != . ]; 
then
         time_day=`date '+%d'`
         time_month=`date '+%m'`
         time_year=`date '+%Y' 2>/dev/null`
@@ -686,7 +686,7 @@
     dst="$2"
     
     #   consistency checks
-    if [ ".$src" = . -o ".$dst" = . ]; then
+    if [ ".$src" = . ] || [ ".$dst" = . ]; then
         echo "$msgprefix:Error: Invalid arguments" 1>&2
         exit 1
     fi
@@ -813,7 +813,7 @@
     fi
     
     #   consistency check for destination
-    if [ $argc -gt 2 -a $dstisdir = 0 ]; then
+    if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then
         echo "$msgprefix:Error: multiple sources require destination to be 
directory" 1>&2
         exit 1
     fi
@@ -940,7 +940,7 @@
     for p in ${1+"$@"}; do
         #   if the directory already exists...
         if [ -d "$p" ]; then
-            if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then
+            if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
                 echo "$msgprefix:Error: directory already exists: $p" 1>&2
                 errstatus=1
                 break
@@ -1098,12 +1098,12 @@
     
         #   split away a common prefix
         prefix=""
-        if [ ".$srcdir" = ".$dstdir" -a ".$srcdir" != . ]; then
+        if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then
             prefix="$srcdir/"
             srcdir=""
             dstdir=""
         else
-            while [ ".$srcdir" != . -a ".$dstdir" != . ]; do
+            while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do
                 presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'`
                 predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'`
                 if [ ".$presrc" != ".$predst" ]; then
@@ -1121,7 +1121,7 @@
         #   determine source prefix which is the reverse directory
         #   step-up corresponding to the destination directory
         srcpre=""
-        if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then
+        if [ $oneisabs = 0 ] || ( [ ".$prefix" != . ] && [ ".$prefix" != ./ ] 
); then
             pl="$dstdir/"
             OIFS="$IFS"; IFS='/'
             for pe in $pl; do
@@ -1167,11 +1167,11 @@
     files="$*"
     
     #   parameter consistency check
-    if [ $# -eq 0 -a ".$opt_b" != . ]; then
+    if [ $# -eq 0 ] && [ ".$opt_b" != . ]; then
         echo "$msgprefix:Error: option -b cannot be applied to stdin" 1>&2
         exit 1
     fi
-    if [ $# -eq 0 -a ".$opt_s" = .yes ]; then
+    if [ $# -eq 0 ] && [ ".$opt_s" = .yes ]; then
         echo "$msgprefix:Error: option -s cannot be applied to stdin" 1>&2
         exit 1
     fi
diff -ur openldap2-2.1.30-old/debian/check_upgradepath 
openldap2-2.1.30/debian/check_upgradepath
--- openldap2-2.1.30-old/debian/check_upgradepath       2004-06-24 
15:12:52.000000000 +0300
+++ openldap2-2.1.30/debian/check_upgradepath   2004-06-25 22:03:59.000000000 
+0300
@@ -14,10 +14,9 @@
 
 # List our packages
 list_packages() {
-       local p ver
-       ver=`dpkg-parsechangelog|sed -ne 's/^Version: //p'`
-       for p in `dh_listpackages`; do
-               (cd .. && echo ${p}_$ver*deb)
+       ver_=`dpkg-parsechangelog|sed -ne 's/^Version: //p'`
+       for p_ in `dh_listpackages`; do
+               (cd .. && echo ${p_}_$ver_*deb)
        done
 }
 
@@ -30,7 +29,7 @@
 # Set a debconf variable inside the chroot
 
 debconf_set() {
-       local name=$1
+       name=$1
        shift
        cat >>$chroot_dir/woody/var/cache/debconf/config.dat <<EOF
 Name: $name
diff -ur openldap2-2.1.30-old/debian/slapd.config 
openldap2-2.1.30/debian/slapd.config
--- openldap2-2.1.30-old/debian/slapd.config    2004-06-24 15:12:52.000000000 
+0300
+++ openldap2-2.1.30/debian/slapd.config        2004-06-25 22:04:55.000000000 
+0300
@@ -84,7 +84,6 @@
  
 # Make sure the values entered make sense
 validate_initial_config() {
-  local invalid
   invalid=""
  
   # Make sure the domain name is valid
@@ -105,7 +104,6 @@
   fi
 
   # Make sure the passwords match
-  local pass1 pass2
   db_get slapd/password1
   pass1="$RET"
   db_get slapd/password2
diff -ur openldap2-2.1.30-old/servers/slapd/Makefile.in 
openldap2-2.1.30/servers/slapd/Makefile.in
--- openldap2-2.1.30-old/servers/slapd/Makefile.in      2004-06-24 
15:12:52.000000000 +0300
+++ openldap2-2.1.30/servers/slapd/Makefile.in  2004-06-25 22:05:27.000000000 
+0300
@@ -283,7 +283,7 @@
 
 depend-local-srv: FORCE
        @for i in back-* shell-backends tools; do \
-               if test -d $$i -a -f $$i/Makefile ; then \
+               if test -d $$i && test -f $$i/Makefile ; then \
                        echo; echo "  cd $$i; $(MAKE) $(MFLAGS) depend"; \
                        ( cd $$i; $(MAKE) $(MFLAGS) depend ); \
                        if test $$? != 0 ; then exit 1; fi ; \
@@ -296,7 +296,7 @@
 
 clean-local-srv: FORCE
        @for i in back-* shell-backends tools; do \
-               if test -d $$i -a -f $$i/Makefile ; then \
+               if test -d $$i && test -f $$i/Makefile ; then \
                        echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
                        ( cd $$i; $(MAKE) $(MFLAGS) clean ); \
                        if test $$? != 0 ; then exit 1; fi ; \
@@ -306,7 +306,7 @@
 
 veryclean-local-srv: FORCE
        @for i in back-* shell-backends tools; do \
-               if test -d $$i -a -f $$i/Makefile ; then \
+               if test -d $$i && test -f $$i/Makefile ; then \
                        echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
                        ( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \
                fi; \
@@ -321,7 +321,7 @@
        $(LTINSTALL) $(INSTALLFLAGS) -s -m 755 \
                slapd$(EXEEXT) $(DESTDIR)$(sbindir)
        @for i in back-* shell-backends tools; do \
-           if test -d $$i -a -f $$i/Makefile ; then \
+           if test -d $$i && test -f $$i/Makefile ; then \
                echo; echo "  cd $$i; $(MAKE) $(MFLAGS) install"; \
                ( cd $$i; $(MAKE) $(MFLAGS) install ); \
                if test $$? != 0 ; then exit 1; fi ; \
diff -ur openldap2-2.1.30-old/tests/scripts/acfilter.sh 
openldap2-2.1.30/tests/scripts/acfilter.sh
--- openldap2-2.1.30-old/tests/scripts/acfilter.sh      2000-06-25 
01:35:20.000000000 +0300
+++ openldap2-2.1.30/tests/scripts/acfilter.sh  2004-06-25 22:10:42.000000000 
+0300
@@ -3,4 +3,4 @@
 #
 # Strip comments
 #
-egrep -iv '^#'
+grep -E -iv '^#'
diff -ur openldap2-2.1.30-old/tests/scripts/test000-rootdse 
openldap2-2.1.30/tests/scripts/test000-rootdse
--- openldap2-2.1.30-old/tests/scripts/test000-rootdse  2002-09-24 
03:05:01.000000000 +0300
+++ openldap2-2.1.30/tests/scripts/test000-rootdse      2004-06-25 
22:11:01.000000000 +0300
@@ -48,7 +48,7 @@
        sleep 5
 done
 
-if test $RC = 0 -a $MONITORDB = yes ; then
+if test $RC = 0 && test $MONITORDB = yes ; then
        echo "Using ldapsearch to retrieve the cn=Monitor..."
        $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT 
'+extensibleObject' >> $SEARCHOUT 2>&1
        RC=$?


--- End Message ---
--- Begin Message ---
Hello,

I'm really sorry it took so long to address this bug. :(

The situation changed significantly over time, so I believe the patches are no longer required.

On Fri, 25 Jun 2004 22:33:40 +0200 David Weinehall <t...@debian.org> wrote:
Several scripts in openldap2 contains XSI:isms (such as `-a' and `-o',
and the use of `trap' with numerical signals, instead of signalnames),
and bashisms (local).  Also egrep is used instead of the grep -E which
is what POSIX recommends.  The included patch fixes these issues.

The current version of Policy 10.4 now allows these assumptions:

- the 'test' command supports -a and -o (since debian-policy 3.7.3.0, #294962)
- the 'trap' command supports numeric signals (since debian-policy 3.9.1.0, 
#477240)
- 'local' is supported (since debian-policy 3.7.3.0, #294962)

For egrep, configure seems to have gained a test for it around 2005 (via an aclocal update) and should now fall back to 'grep -E' automatically if egrep is not available.

To summarize, I modified my unstable chroot with:

1. ln -sf /usr/bin/posh /bin/sh
2. rm /bin/egrep

and tried to build the package. Configure and build worked; the test suite didn't work, because posh lacks a 'kill' built-in, but I consider this a trivial issue since Debian's default /bin/sh does have it. (If it didn't, I would Build-Depend on a package providing /bin/kill.)

My apologies once again for leaving this so long. I'll close the bug now as I believe the patches aren't needed, but feel free to reopen if you find that something still needs fixing.

thanks,
Ryan

--- End Message ---

Reply via email to