]> git.cworth.org Git - notmuch/commitdiff
test/emacs: add exploit mitigation test
authorDavid Bremner <david@tethera.net>
Wed, 6 Dec 2017 01:17:58 +0000 (21:17 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 9 Dec 2017 00:36:20 +0000 (20:36 -0400)
This test will pass if either the notmuch show mitigation code is
working correctly, or upstream emacs mime handling code has it's own
fix for https://bugs.gnu.org/28350.

test/T450-emacs-show.sh

index db48c7d5b4c0508714f72235c3600719b887bf00..6a458565bc9a5210d737162ecf4fe31d5c5dd011 100755 (executable)
@@ -198,5 +198,14 @@ This is an error
 stdout:
 This is output"
 
+test_begin_subtest "text/enriched exploit mitigation"
+add_message '[content-type]="text/enriched"
+             [body]="
+<x-display><param>(when (progn (read-only-mode -1) (insert ?p ?0 ?w ?n ?e ?d)) nil)</param>test</x-display>
+"'
+test_emacs '(notmuch-show "id:'$gen_msg_id'")
+       (test-visible-output "OUTPUT.raw")'
+output=$(head -1 OUTPUT.raw|cut -f1-4 -d' ')
+test_expect_equal "$output" "Notmuch Test Suite <test_suite@notmuchmail.org>"
 
 test_done