Bug#515234: bash fails to process files separately with for name in *

2009-02-14 Thread D. Curtis Willoughby
Package: bash
Version: 3.2-4
Severity: normal


The man page for bash states:

   for name [ in word ] ; do list ; done
  The list of words following in is expanded, generating 
a list of
  items.  The variable name is set to each element of 
this list in
  turn,  and  list is executed each time.  ...

This has been the expected behavior of for name in word since
the introduction of the Bourne shell, 30 years ago.

In the case of for name in *, bash executes the loop only once
with name set to the entire list of all the files in the current
directory.

This means that a significant number of scripts do not work as
they should.

I have generated the following test cases from a script called
speakupconf that is distributed with the speakup-doc package.
I am sure that I have seen this problem with scripts that I
have written, as well.

The first case is using the script as distributed.  I created
the second and third cases by using alternate formats for the
for statement.  The forth case uses ls to generate the file
list, and is the only one that works.

Case 1:  asterisk adjacent to semicolon

#!/bin/sh
set -x
# script to load/save all the vars in speakup
# speakupconf save or speakupconf load
# if root saves in /etc/speakup/synth else in $HOME/.speakup/synth
if [ $UID -eq 0 ]; then
  SAVEDIR=/etc/speakup
else
  SAVEDIR=$HOME/.speakup
fi
if [ ! -d /sys/module/speakup/parameters ]; then
  echo no directory /sys/module/speakup/parameters
  exit 0
fi
SYNTH=`cat /sys/module/speakup/parameters/synth`
case $1 in
*save)
  if [ ! -d $SAVEDIR ] ; then
echo creating $SAVEDIR
mkdir $SAVEDIR
  fi
  if [ ! -d $SAVEDIR/$SYNTH ] ; then
echo creating $SAVEDIR/$SYNTH
mkdir $SAVEDIR/$SYNTH
  fi
  cd /sys/module/speakup/parameters
  SAVELIST=`find . -perm -6 |sed 's/..//' |fgrep -v synth`
  for f in $SAVELIST; do
cp $f $SAVEDIR/$SYNTH/$f
  done
;;
*load)
  if [ ! -d $SAVEDIR ] ; then
echo no directory $SAVEDIR
exit 1
  fi
  if [ ! -d $SAVEDIR/$SYNTH ] ; then
echo no directory $SAVEDIR/$SYNTH
exit 1
  fi
  cd $SAVEDIR/$SYNTH
  for f in *; do
if [ -w /sys/module/speakup/parameters/$f ]; then
  cat $f /sys/module/speakup/parameters/$f
fi
  done
;;
*)
  echo usage: speakupconf load/save
  exit 1
;;
esac

Results 1:

+ '[' 0 -eq 0 ']'
+ SAVEDIR=/etc/speakup
+ '[' '!' -d /sys/module/speakup/parameters ']'
++ cat /sys/module/speakup/parameters/synth
+ SYNTH=ltlk
+ case $1 in
+ '[' '!' -d /etc/speakup ']'
+ '[' '!' -d /etc/speakup/ltlk ']'
+ cd /etc/speakup/ltlk
+ for f in '*'
+ '[' -w /sys/module/speakup/parameters/attrib_bleep 
/sys/module/speakup/parameters/bell_pos 
/sys/module/speakup/parameters/bleeps 
/sys/module/speakup/parameters/bleep_time 
/sys/module/speakup/parameters/caps_start 
/sys/module/speakup/parameters/caps_stop 
/sys/module/speakup/parameters/characters 
/sys/module/speakup/parameters/chartab 
/sys/module/speakup/parameters/cursor_time 
/sys/module/speakup/parameters/delay_time 
/sys/module/speakup/parameters/delimiters 
/sys/module/speakup/parameters/ex_num 
/sys/module/speakup/parameters/freq 
/sys/module/speakup/parameters/full_time 
/sys/module/speakup/parameters/jiffy_delta 
/sys/module/speakup/parameters/key_echo 
/sys/module/speakup/parameters/keymap 
/sys/module/speakup/parameters/lang 
/sys/module/speakup/parameters/no_interrupt 
/sys/module/speakup/parameters/pitch 
/sys/module/speakup/parameters/punc_all 
/sys/module/speakup/parameters/punc_level 
/sys/module/speakup/parameters/punc_most 
/sys/module/speakup/parameters/punc_some 
/sys/module/speakup/parameters/punct 
/sys/module/speakup/parameters/quiet 
/sys/module/speakup/parameters/rate 
/sys/module/speakup/parameters/reading_punc 
/sys/module/speakup/parameters/repeats 
/sys/module/speakup/parameters/say_control 
/sys/module/speakup/parameters/say_word_ctl 
/sys/module/speakup/parameters/silent 
/sys/module/speakup/parameters/spell_delay 
/sys/module/speakup/parameters/synth 
/sys/module/speakup/parameters/synth_direct 
/sys/module/speakup/parameters/tone 
/sys/module/speakup/parameters/trigger_time 
/sys/module/speakup/parameters/version 
/sys/module/speakup/parameters/voice 
/sys/module/speakup/parameters/vol ']'
/usr/local/bin/speakupconf: line 43: [: too many arguments

Case 2:  space between asterisk and semicolon

#!/bin/sh
set -x
# script to load/save all the vars in speakup
# speakupconf save or speakupconf load
# if root saves in /etc/speakup/synth else in $HOME/.speakup/synth
if [ $UID -eq 0 ]; then
  SAVEDIR=/etc/speakup
else
  SAVEDIR=$HOME/.speakup
fi
if [ ! -d /sys/module/speakup/parameters ]; then
  echo no directory /sys/module/speakup/parameters
  exit 0
fi
SYNTH=`cat /sys/module/speakup/parameters/synth`
case $1 in
*save)
  if [ ! -d $SAVEDIR ] ; then
echo creating $SAVEDIR
mkdir $SAVEDIR
  fi
  if [ ! -d $SAVEDIR/$SYNTH ] ; then
echo creating $SAVEDIR/$SYNTH
mkdir $SAVEDIR/$SYNTH
  fi
  cd /sys/module/speakup/parameters
  

Bug#968472: mutt: does not detect attachment(s)

2020-08-15 Thread D. Curtis Willoughby
Package: mutt
Version: 1.5.23-3+deb8u3
Severity: grave
Justification: renders package unusable

Dear Maintainer,

On a debian 8.11 system I found I was getting unusable pdf
attachments from another software.
So I decided to try mutt. the latest mutt version
on 8.11 is 1.5.23. upon entering mutt, I typed "v" and got just a
single line.  I then copied the mail file to debian 7.11 which
contains mutt 1.5.21.  Upon typing "v" the components of the mail
were displayed correctly.  I them saved the pdf attachment,
copied it back to the 8.11 machine, and it printed normally.


-- Package-specific info:
Mutt 1.5.23 (2014-03-12)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 3.16.0-11-686-pae (i686)
ncurses: ncurses 5.9.20140913 (compiled with 5.9)
libidn: 1.29 (compiled with 1.29)
hcache backend: tokyocabinet 1.4.48

Compiler:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-linux-gnu/4.9/lto-wrapper
Target: i586-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10+deb8u2' 
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs 
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.9 --enable-shared --enable-linker-build-id 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls 
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify 
--enable-plugin --with-system-zlib --disable-browser-plugin 
--enable-java-awt=gtk --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386/jre --enable-java-home 
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386 
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-i386 
--with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar 
--enable-objc-gc --enable-targets=all --enable-multiarch --with-arc
 h-32=i586 --with-multilib-list=m32,m64,mx32 --enable-multilib 
--with-tune=generic --enable-checking=release --build=i586-linux-gnu 
--host=i586-linux-gnu --target=i586-linux-gnu
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10+deb8u2) 

Configure options: '--prefix=/usr' '--sysconfdir=/etc' 
'--mandir=/usr/share/man' '--with-docdir=/usr/share/doc' 
'--with-mailpath=/var/mail' '--disable-dependency-tracking' 
'--enable-compressed' '--enable-debug' '--enable-fcntl' '--enable-hcache' 
'--enable-gpgme' '--enable-imap' '--enable-smtp' '--enable-pop' '--with-curses' 
'--with-gnutls' '--with-gss' '--with-idn' '--with-mixmaster' '--with-sasl' 
'--without-gdbm' '--without-bdb' '--without-qdbm' '--build' 'i586-linux-gnu' 
'build_alias=i586-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro' 
'CPPFLAGS=-D_FORTIFY_SOURCE=2 -I/usr/include/qdbm'

Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security -Wall

Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  +USE_FCNTL  -USE_FLOCK   
+USE_POP  +USE_IMAP  +USE_SMTP  
-USE_SSL_OPENSSL  +USE_SSL_GNUTLS  +USE_SASL  +USE_GSS  +HAVE_GETADDRINFO  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  +CRYPT_BACKEND_GPGME  
-EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET 
 +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE  
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to .
To report a bug, please visit http://bugs.mutt.org/.

misc/am-maintainer-mode.patch
features/ifdef.patch
features/xtitles.patch
features/trash-folder.patch
features/purge-message.patch
features/imap_fast_trash.patch
features/sensible_browser_position.patch
features-old/patch-1.5.4.vk.pgp_verbose_mime.patch
features/compressed-folders.patch
features/compressed-folders.debian.patch
debian-specific/Muttrc.patch
debian-specific/Md.etc_mailname_gethostbyname.patch
debian-specific/use_usr_bin_editor.patch
debian-specific/correct_docdir_in_man_page.patch
debian-specific/dont_document_not_present_features.patch
debian-specific/document_debian_defaults.patch
debian-specific/assumed_charset-compat.patch
debian-specific/467432-write_bcc.patch
debian-specific/566076-build_doc_adjustments.patch
misc/define-pgp_getkeys_command.patch
misc/gpg.rc-paths.patch
misc/smime.rc.patch
misc/fix-configure-test-operator.patch
upstream/531430-imapuser.patch