From: David Bremner Date: Tue, 11 Jun 2019 23:41:35 +0000 (-0300) Subject: Merge branch 'release' X-Git-Tag: archive/debian/0.30_rc0-1~172 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=0a2929c341b6d5f20210725facf37a6e2c3a19b4;hp=20842dfb6d64f4469c554525ab4c27c6571fbdfe Merge branch 'release' --- diff --git a/debian/control b/debian/control index 31d6471c..ff646c6b 100644 --- a/debian/control +++ b/debian/control @@ -29,7 +29,7 @@ Build-Depends: gnupg , bash-completion (>=1.9.0~), texinfo -Standards-Version: 4.1.3 +Standards-Version: 4.3.0 Homepage: https://notmuchmail.org/ Vcs-Git: https://git.notmuchmail.org/git/notmuch -b release Vcs-Browser: https://git.notmuchmail.org/git/notmuch @@ -77,6 +77,8 @@ Package: python-notmuch Architecture: all Section: python Depends: ${misc:Depends}, ${python:Depends}, libnotmuch5 (>= ${source:Version}) +Provides: ${python:Provides} +XB-Python-Version: ${python:Versions} Description: Python interface to the notmuch mail search and index library Notmuch is a system for indexing, searching, reading, and tagging large collections of email messages in maildir or mh format. It uses @@ -152,7 +154,8 @@ Depends: notmuch (>= 0.4), libmail-box-perl, libmailtools-perl, libstring-shellquote-perl, libterm-readline-gnu-perl, - ${misc:Depends} + ${misc:Depends}, + ${perl:Depends}, Recommends: mutt Enhances: notmuch, mutt Description: thread-based email index, search and tagging (Mutt interface) diff --git a/debian/rules b/debian/rules index d056edb6..ebd10481 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,8 @@ python3_all = py3versions -s | xargs -n1 | xargs -t -I {} env {} +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + %: dh $@ --with python2,python3,elpa diff --git a/lib/messages.c b/lib/messages.c index 04fa19f8..7ddfaf26 100644 --- a/lib/messages.c +++ b/lib/messages.c @@ -117,7 +117,7 @@ _notmuch_messages_has_next (notmuch_messages_t *messages) return false; if (! messages->is_of_list_type) - INTERNAL_ERROR("_notmuch_messages_has_next not implimented for msets"); + INTERNAL_ERROR("_notmuch_messages_has_next not implemented for msets"); return (messages->iterator->next != NULL); } diff --git a/notmuch-client.h b/notmuch-client.h index 39e26f2e..b3a501a9 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -53,7 +53,7 @@ #include "talloc-extra.h" #include "crypto.h" -#define unused(x) x __attribute__ ((unused)) +#define unused(x) x ## _unused __attribute__ ((unused)) #define STRINGIFY(s) STRINGIFY_(s) #define STRINGIFY_(s) #s diff --git a/notmuch-setup.c b/notmuch-setup.c index 53048005..81419ccf 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -121,7 +121,7 @@ parse_tag_list (void *ctx, char *response) int notmuch_setup_command (notmuch_config_t *config, - unused (int argc), unused (char *argv[])) + int argc, char *argv[]) { char *response = NULL; size_t response_size = 0; diff --git a/notmuch.c b/notmuch.c index eeb794e8..2ddc8fbc 100644 --- a/notmuch.c +++ b/notmuch.c @@ -358,7 +358,7 @@ notmuch_help_command (unused (notmuch_config_t * config), int argc, char *argv[] */ static int notmuch_command (notmuch_config_t *config, - unused(int argc), unused(char *argv[])) + unused(int argc), unused(char **argv)) { char *db_path; struct stat st; diff --git a/performance-test/M00-new.sh b/performance-test/M00-new.sh index aab36e69..5858ab33 100755 --- a/performance-test/M00-new.sh +++ b/performance-test/M00-new.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='notmuch new' diff --git a/performance-test/M01-dump-restore.sh b/performance-test/M01-dump-restore.sh index 32ab8dc9..7850b411 100755 --- a/performance-test/M01-dump-restore.sh +++ b/performance-test/M01-dump-restore.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='dump and restore' diff --git a/performance-test/M02-show.sh b/performance-test/M02-show.sh index 2e218fd3..40c5d4d7 100755 --- a/performance-test/M02-show.sh +++ b/performance-test/M02-show.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='show' diff --git a/performance-test/M03-search.sh b/performance-test/M03-search.sh index 343f5c7c..a73a36ab 100755 --- a/performance-test/M03-search.sh +++ b/performance-test/M03-search.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='search' diff --git a/performance-test/M04-reply.sh b/performance-test/M04-reply.sh index 3c1205db..3b0f9e78 100755 --- a/performance-test/M04-reply.sh +++ b/performance-test/M04-reply.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='search' diff --git a/performance-test/M05-reindex.sh b/performance-test/M05-reindex.sh index 17e2c824..8ea7e7ee 100755 --- a/performance-test/M05-reindex.sh +++ b/performance-test/M05-reindex.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='reindex' diff --git a/performance-test/M06-insert.sh b/performance-test/M06-insert.sh index 5ae0656a..12330c76 100755 --- a/performance-test/M06-insert.sh +++ b/performance-test/M06-insert.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='search' diff --git a/performance-test/T00-new.sh b/performance-test/T00-new.sh index 25391136..a14dd13f 100755 --- a/performance-test/T00-new.sh +++ b/performance-test/T00-new.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='notmuch new' diff --git a/performance-test/T01-dump-restore.sh b/performance-test/T01-dump-restore.sh index 12f12e66..2a53e3b8 100755 --- a/performance-test/T01-dump-restore.sh +++ b/performance-test/T01-dump-restore.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='dump and restore' diff --git a/performance-test/T02-tag.sh b/performance-test/T02-tag.sh index 8c5dfd68..9c895d6a 100755 --- a/performance-test/T02-tag.sh +++ b/performance-test/T02-tag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='tagging' diff --git a/performance-test/T03-reindex.sh b/performance-test/T03-reindex.sh index 8e0a77f4..8db52a33 100755 --- a/performance-test/T03-reindex.sh +++ b/performance-test/T03-reindex.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='reindexing' diff --git a/performance-test/T04-thread-subquery.sh b/performance-test/T04-thread-subquery.sh index 665d5a64..ba81f383 100755 --- a/performance-test/T04-thread-subquery.sh +++ b/performance-test/T04-thread-subquery.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='thread subqueries' diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index 8a2d4c02..1ac2836a 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -226,6 +226,7 @@ output=$(notmuch dump | LC_ALL=C sort) expected='#= simple-encrypted@crypto.notmuchmail.org index.decryption=failure #notmuch-dump batch-tag:3 config,properties,tags +encrypted +inbox +unread -- id:basic-encrypted@crypto.notmuchmail.org ++encrypted +inbox +unread -- id:encrypted-signed@crypto.notmuchmail.org +encrypted +inbox +unread -- id:simple-encrypted@crypto.notmuchmail.org' test_expect_equal \ "$output" \ @@ -288,6 +289,24 @@ test_expect_equal \ "$output" \ "$expected" +goodsig='good_sig:[0][0][0]["crypto"]["signed"]["status"][0]["status"]="good"' +nosig='no_sig:[0][0][0]["crypto"]!"signed"' + +test_begin_subtest "verify signature without a session key stashed when --decrypt=true" +output=$(notmuch show --format=json --decrypt=true id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$goodsig" + +test_begin_subtest "do not verify sig without a session key stashed if --decrypt=auto" +output=$(notmuch show --format=json id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$nosig" + +test_begin_subtest "verify signature when --decrypt=stash" +output=$(notmuch show --format=json --decrypt=stash id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$goodsig" + +test_begin_subtest "verify signature with stashed session key" +output=$(notmuch show --format=json id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$goodsig" # TODO: test removal of a message from the message store between # indexing and reindexing. diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh index 63228546..05fb0a92 100755 --- a/test/aggregate-results.sh +++ b/test/aggregate-results.sh @@ -13,81 +13,61 @@ do while read type value do case $type in - '') - continue ;; fixed) - fixed=$(($fixed + $value)) ;; + fixed=$((fixed + value)) ;; success) - success=$(($success + $value)) ;; + success=$((success + value)) ;; failed) - failed=$(($failed + $value)) ;; + failed=$((failed + value)) ;; broken) - broken=$(($broken + $value)) ;; + broken=$((broken + value)) ;; total) - total=$(($total + $value)) ;; + total=$((total + value)) ;; esac done <"$file" done -pluralize () { - case $2 in - 1) - case $1 in - test) - echo test ;; - failure) - echo failure ;; - esac - ;; - *) - case $1 in - test) - echo tests ;; - failure) - echo failures ;; - esac - ;; - esac -} +pluralize_s () { [ "$1" -eq 1 ] && s='' || s='s'; } echo "Notmuch test suite complete." -if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then - tests=$(pluralize "test" $total) - printf "All $total $tests " - if [ "$broken" = "0" ]; then - echo "passed." - else - failures=$(pluralize "failure" $broken) - echo "behaved as expected ($broken expected $failures)." - fi; + +if [ "$fixed" -eq 0 ] && [ "$failed" -eq 0 ]; then + pluralize_s "$total" + printf "All $total test$s " + if [ "$broken" -eq 0 ]; then + echo "passed." + else + pluralize_s "$broken" + echo "behaved as expected ($broken expected failure$s)." + fi else - echo "$success/$total tests passed." - if [ "$broken" != "0" ]; then - tests=$(pluralize "test" $broken) - echo "$broken broken $tests failed as expected." - fi - if [ "$fixed" != "0" ]; then - tests=$(pluralize "test" $fixed) - echo "$fixed broken $tests now fixed." - fi - if [ "$failed" != "0" ]; then - tests=$(pluralize "test" $failed) - echo "$failed $tests failed." - fi + echo "$success/$total tests passed." + if [ "$broken" -ne 0 ]; then + pluralize_s "$broken" + echo "$broken broken test$s failed as expected." + fi + if [ "$fixed" -ne 0 ]; then + pluralize_s "$fixed" + echo "$fixed broken test$s now fixed." + fi + if [ "$failed" -ne 0 ]; then + pluralize_s "$failed" + echo "$failed test$s failed." + fi fi -skipped=$(($total - $fixed - $success - $failed - $broken)) -if [ "$skipped" != "0" ]; then - tests=$(pluralize "test" $skipped) - echo "$skipped $tests skipped." +skipped=$((total - fixed - success - failed - broken)) +if [ "$skipped" -ne 0 ]; then + pluralize_s "$skipped" + echo "$skipped test$s skipped." fi # Note that we currently do not consider skipped tests as failing the # build. -if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 ] +if [ "$success" -gt 0 ] && [ "$fixed" -eq 0 ] && [ "$failed" -eq 0 ] then - exit 0 + exit 0 else - exit 1 + exit 1 fi diff --git a/test/corpora/crypto/encrypted-signed.eml b/test/corpora/crypto/encrypted-signed.eml new file mode 100644 index 00000000..0345e3e9 --- /dev/null +++ b/test/corpora/crypto/encrypted-signed.eml @@ -0,0 +1,35 @@ +From: test_suite@notmuchmail.org +To: test_suite@notmuchmail.org +Subject: Lyrics +Date: Wed 29 May 2019 06:09:22 PM EDT +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/encrypted; boundary="=-=-="; + protocol="application/pgp-encrypted" + +--=-=-= +Content-Type: application/pgp-encrypted + +Version: 1 + +--=-=-= +Content-Type: application/octet-stream + +-----BEGIN PGP MESSAGE----- + +hIwDxE023q1UqxYBBAC9z781zV7QAInGMKHX6TKU5Xw/OkoWXahpDL88F6Ocm5R9 +7M9z2ocvlyrbgRhqE+nvFeGH/K7rVkBBT6TAcdIe/C8Qzbd3stPPcx1PlunGROj7 +H/WAcmDksK3HkXpHwmInUtzNw1pkhOoLy/sFSbPvtyg8GCUzXbafHAIIo0rB2tLB +DwGWD3l4WdcyQWuYD9QJKuDIqdWo8E3TTcKkiOAt/6liwPNZ0jGzDeCuSTnWFj6Z +AiXGeNtD3I1tCN/8T3NjEKOCQ+bdT5Y06dDaL61FpQ23eIuSUgksVxjnkEAb6iPe +07gjzcyNuGP3WPI/0qu0wtZwpAQxvaNygDsQj/OjR5kn9luBd/VqodM3TWWS8miV +m0z1tYbqYAQWW6TS7fXlsyXoOxTLW5MCfe3D36VSErL/NJItETklVKzNfKjMmRKx +CI2ZUzugxPWSLQzOp5yl7iICk8e+vS9TkQw2j0nXAQYLYgmqZMhf4av5GlFv3tQu +heO4XLT6NBDTHMFTDbgW42kE0N4MDPc29AqVFGImcTHvflF4Vp0qIbSJdIcHwKkU +5LKqvicAa0lsIoJbsW3lHrzowyjov2vLH/VGd/wIX+MS3KT7cySdyp8HVMcwwyZu +Y9nrTN/7G1FwKWlcGa4uJNcFFkYlcEymZj1EX2cyrdezPtX7K5vhwBYddptFD+Bn +IVkghRut3UDeXe83F8OutWiZfK5EVYABq/aP3//hIbQl2o4Dkd3z9m+8LobrIV5s +NXjAjU5WQOjRLoHBebG2HkMpFsWhXD/Fb/Bb58VOpdI= +=x12v +-----END PGP MESSAGE----- +--=-=-=--