gbranden pushed a commit to branch master
in repository groff.

commit 3d1bcd53e5581b200ba2ae3e89acd6e4fc585570
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Sep 22 22:30:59 2026 -0500

    [mm]: Regression-test Savannah #68689.
    
    * contrib/mm/tests/mmroff-does-not-defeat-safer-mode.sh: Do it.
    
    * contrib/mm/mm.am (mm_TESTS): Run test.
    
    Test fails at this commit.
---
 contrib/mm/ChangeLog                               |  7 +++
 contrib/mm/mm.am                                   |  1 +
 .../mm/tests/mmroff-does-not-defeat-safer-mode.sh  | 52 ++++++++++++++++++++++
 3 files changed, 60 insertions(+)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index b687f7248..59df6116d 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,10 @@
+2026-09-22  G. Branden Robinson <[email protected]>
+
+       Regression-test Savannah #68689.
+
+       * tests/mmroff-does-not-defeat-safer-mode.sh: Do it.
+       * mm.am (mm_TESTS): Run test.
+
 2026-10-01  G. Branden Robinson <[email protected]>
 
        Fix Savannah #68727.
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index 9d96bc1f9..772732b00 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -93,6 +93,7 @@ mm_TESTS = \
   contrib/mm/tests/lists-indent-correctly.sh \
   contrib/mm/tests/marks-in-nested-ML-lists-are-correct.sh \
   contrib/mm/tests/memoranda-format-correctly.sh \
+  contrib/mm/tests/mmroff-does-not-defeat-safer-mode.sh \
   contrib/mm/tests/ms-cover-sheet-robust-to-missing-AF.sh \
   contrib/mm/tests/mse_has-sufficient-footnote-space.sh \
   contrib/mm/tests/nP-works.sh \
diff --git a/contrib/mm/tests/mmroff-does-not-defeat-safer-mode.sh 
b/contrib/mm/tests/mmroff-does-not-defeat-safer-mode.sh
new file mode 100755
index 000000000..97f327809
--- /dev/null
+++ b/contrib/mm/tests/mmroff-does-not-defeat-safer-mode.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of mm, a reimplementation of the Documenter's
+# Workbench (DWB) troff memorandum macro package for use with GNU troff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+mmroff="${abs_top_builddir:-.}/mmroff"
+
+# Regression-test Savannah #68689.
+#
+# The mmroff script should not permit defeat of troff's "safer mode".
+
+sandbox_dir=$(mktemp -d)
+if [ $? -ne 0 ]
+then
+    echo "cannot create temporary directory; skipping" >&2
+    exit 77 # skip
+fi
+
+# This method is based on a reproducer by Pavol Sloboda.
+
+oops_file="$sandbox_dir"/oops
+
+input='.
+.tm .\\" PIC llx '"'"';qx(id>'"$oops_file"');#
+.'
+
+printf "%s\n" "$input" | "$mmroff"
+
+if ! test -f "$oops_file"
+then
+    rmdir "$sandbox_dir"
+else
+    echo "test failed; file left in \"$oops_file\"" >&2
+    exit 1
+fi
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to