]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use system dictionary for db2 tests again
authorGreg Hudson <ghudson@mit.edu>
Tue, 18 Feb 2014 06:14:01 +0000 (01:14 -0500)
committerGreg Hudson <ghudson@mit.edu>
Wed, 19 Feb 2014 21:21:01 +0000 (16:21 -0500)
The built-in word list is not long enough for all of the libdb2 tests
to run properly.  Revert d21a86e47a7cda29225013e08d060095b94b2ee7 and
go back to using the system dictionary if we find one.  However, omit
any lines from the chosen word list which contain non-alphabetical
characters.

ticket: 7860

src/plugins/kdb/db2/libdb2/test/run.test

index 81db7f7f1c7ad52ded40a07802b050fd8f1cca28..d99b42d8b37fa3b7f44cddf8434fc81755f5509f 100644 (file)
@@ -15,6 +15,14 @@ main()
 
        if [ \! -z "$WORDLIST" -a -f "$WORDLIST" ]; then
                DICT=$WORDLIST
+       elif [ -f /usr/local/lib/dict/words ]; then
+               DICT=/usr/local/lib/dict/words
+       elif [ -f /usr/share/dict/words ]; then
+               DICT=/usr/share/dict/words
+       elif [ -f /usr/dict/words ]; then
+               DICT=/usr/dict/words
+       elif [ -f /usr/share/lib/dict/words ]; then
+               DICT=/usr/share/lib/dict/words
        elif [ -f $srcdir/../test/dictionary ]; then
                DICT=`cd $srcdir/../test && pwd`/dictionary
        else
@@ -63,10 +71,11 @@ main()
 }
 
 getnwords() {
-       # Delete blank lines because the db code appears not to
-       # like empty keys.  On Debian Linux, $DICT appears to contain
-       # some non-ASCII characters, and "rev" chokes on them.
-       sed -e '/^$/d' < $DICT | cat -v | sed -e ${1}q
+       # Delete blank lines because the db code appears not to like
+       # empty keys.  Omit lines with non-alphanumeric characters to
+       # avoid shell metacharacters and non-ASCII characters which
+       # could cause 'rev' to choke.
+       LC_ALL=C sed -e '/^$/d' -e '/[^A-Za-z]/d' < $DICT | sed -e ${1}q
 }
 
 # Take the first hundred entries in the dictionary, and make them