diff -Nru antiword-0.37/debian/antiword.docs antiword-0.37/debian/antiword.docs --- antiword-0.37/debian/antiword.docs 2013-05-30 05:32:09.000000000 +0000 +++ antiword-0.37/debian/antiword.docs 2018-11-29 19:28:38.000000000 +0000 @@ -1,4 +1,2 @@ Docs/FAQ -Docs/Netscape -Docs/QandA Docs/ReadMe diff -Nru antiword-0.37/debian/antiword.examples antiword-0.37/debian/antiword.examples --- antiword-0.37/debian/antiword.examples 2013-05-30 04:55:41.000000000 +0000 +++ antiword-0.37/debian/antiword.examples 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/kantiwordrc diff -Nru antiword-0.37/debian/antiword.manpages antiword-0.37/debian/antiword.manpages --- antiword-0.37/debian/antiword.manpages 2013-05-30 04:53:29.000000000 +0000 +++ antiword-0.37/debian/antiword.manpages 2019-07-31 20:26:44.000000000 +0000 @@ -1,2 +1 @@ Docs/antiword.1 -debian/kantiword.1 diff -Nru antiword-0.37/debian/changelog antiword-0.37/debian/changelog --- antiword-0.37/debian/changelog 2018-04-03 12:13:03.000000000 +0000 +++ antiword-0.37/debian/changelog 2022-06-19 16:43:28.000000000 +0000 @@ -1,8 +1,62 @@ -antiword (0.37-11build1) bionic; urgency=high +antiword (0.37-16~18.04.sav0) bionic; urgency=medium - * No change rebuild to pick up -fPIE compiler default + * Backport to Bionic + * debian/control: Set debhelper-compat (= 11) BD - -- Balint Reczey Tue, 03 Apr 2018 12:13:03 +0000 + -- Rob Savoury Sun, 19 Jun 2022 09:43:28 -0700 + +antiword (0.37-16) unstable; urgency=medium + + [ Helmut Grohne ] + * Mark antiword Multi-Arch: foreign. (Closes: #952699) + + [ Olly Betts ] + * debian/control: Mark conformance with policy 4.4.0. + + -- Olly Betts Fri, 28 Feb 2020 13:47:51 +1300 + +antiword (0.37-15) unstable; urgency=medium + + * Upgrade to debhelper compat 12 and use debhelper-compat B-D to specify + this. + * debian/control: Mark conformance with policy 4.4.0. + * Stop shipping kantiword - it doesn't actually work yet nobody's reported + a bug, so it seems we can safely conclude it is no longer in active use. + + -- Olly Betts Thu, 01 Aug 2019 09:03:14 +1200 + +antiword (0.37-14) unstable; urgency=medium + + * debian/control: Mark conformance with policy 4.3.0. + * debian/control: Specify "Rules-Requires-Root: no" + + -- Olly Betts Wed, 09 Jan 2019 16:34:14 +1300 + +antiword (0.37-13) unstable; urgency=medium + + * debian/tests/smoke: Fix CI testcase. + * debian/antiword.docs: Stop packaging docs on how to integrate with + Netscape mail 4.7, and FAQs specific to RISC OS. + * debian/patches/use-snprintf.patch: Use snprintf() when converting dates + to strings to make completely sure we can't overrun the buffer. + * debian/rules: Build with -Wno-unused-but-set-variable to suppress + uninteresting warnings. + * debian/patches: Update to use https links in patch metadata. + + -- Olly Betts Fri, 30 Nov 2018 08:28:38 +1300 + +antiword (0.37-12) unstable; urgency=medium + + * debian/rules: Enable all hardening flags. + * debian/tests/: Add simple autopkgtest. + * debian/control: Note in description that the newer XML-based formats + aren't supported. + * debian/control: Mark conformance with policy 4.2.1. + * debian/compat,debian/control: Update to debhelper compat 11. + * debian/rules: Only set DEB_HOST_GNU_TYPE if not already set. + * debian/changelog: Remove trailing whitespace. + + -- Olly Betts Thu, 29 Nov 2018 09:01:29 +1300 antiword (0.37-11) unstable; urgency=medium @@ -132,9 +186,9 @@ antiword (0.35-2) unstable; urgency=high * fix copyright file to actually include the copyright, closes: #290056 - * patch from Steve Kemp to fix insecure use of temporary files by kantiword + * patch from Steve Kemp to fix insecure use of temporary files by kantiword and gantiword scripts. [CVE-2005-3126] - * freshen policy and debhelper versions, minor rules tweaks + * freshen policy and debhelper versions, minor rules tweaks -- Bdale Garbee Thu, 12 Jan 2006 09:08:33 -0700 diff -Nru antiword-0.37/debian/compat antiword-0.37/debian/compat --- antiword-0.37/debian/compat 2013-05-30 04:45:18.000000000 +0000 +++ antiword-0.37/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru antiword-0.37/debian/control antiword-0.37/debian/control --- antiword-0.37/debian/control 2018-04-03 12:13:03.000000000 +0000 +++ antiword-0.37/debian/control 2022-06-19 16:43:28.000000000 +0000 @@ -1,17 +1,21 @@ Source: antiword Section: text Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Olly Betts -Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.6 +Maintainer: Olly Betts +Build-Depends: debhelper-compat (= 11) +Standards-Version: 4.5.0 Homepage: http://www.winfield.demon.nl/ +Rules-Requires-Root: no Package: antiword Architecture: any +Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends} Description: Converts MS Word files to text, PS, PDF and XML Antiword is a free MS Word reader. . It converts the binary files from MS Word 2, 6, 7, 97, 2000 and 2003 to text, Postscript, PDF and XML. + . + Note that it doesn't support the XML-based formats which newer MS Word + versions produce by default (.docx). diff -Nru antiword-0.37/debian/dirs antiword-0.37/debian/dirs --- antiword-0.37/debian/dirs 2011-11-26 12:48:07.000000000 +0000 +++ antiword-0.37/debian/dirs 2019-07-31 20:59:40.000000000 +0000 @@ -1,7 +1,2 @@ usr/bin usr/share/antiword -usr/share/applnk/Utilities -usr/share/icons/locolor/16x16/apps -usr/share/icons/locolor/32x32/apps -usr/share/icons/hicolor/32x32/apps -usr/share/icons/hicolor/48x48/apps diff -Nru antiword-0.37/debian/kantiword.1 antiword-0.37/debian/kantiword.1 --- antiword-0.37/debian/kantiword.1 2011-11-26 12:48:07.000000000 +0000 +++ antiword-0.37/debian/kantiword.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -.TH KANTIWORD 1 "Jun 03, 2009" "Antiword 0.37" "Linux User's Manual" -.SH NAME -kantiword \- installs desktop icon for d'n'd function of antiword -.SH SYNOPSIS -.B kantiword -[ -.I papersize " wordfile" -] -.SH DESCRIPTION -.I kantiword -is a helper script for antiword(1), an application that displays the -text and the images of Microsoft Word documents. -.br -Kantiword can be used to install an icon on your destop -(into ~/Desktop dir), if it will be invoked with less that 2 -parameters. -.br -If it is called with 2 parameters, it will convert a copy of -wordfile to PDF and display it. Plain text output will be used, if no -PDF viewer like kpdf, xpdf or gv is installed. - -.SH PARAMETER -.TP -.B papersize -paper size ('a4' or 'letter') of given wordfile. -.TP -.B wordfile -Microsoft Word document to display. - -.SH SEE ALSO -.BR antiword (1). -.br - -.SH AUTHOR -kantiword was written by Adri van Os -and adapted by Erik Schanze . -.PP -This manual page was written by Erik Schanze , -for the Debian project (but may be used by others). - -.SH ACKNOWLEDGEMENTS -Linux is a registered trademark of Linus Torvalds. -.br -Adobe, PDF and PostScript are trademarks of Adobe Systems Incorporated. -.br -Microsoft is a registered trademark and Windows is a trademark of Microsoft -Corporation. diff -Nru antiword-0.37/debian/Kantiword-Installer.desktop antiword-0.37/debian/Kantiword-Installer.desktop --- antiword-0.37/debian/Kantiword-Installer.desktop 2011-11-26 12:48:07.000000000 +0000 +++ antiword-0.37/debian/Kantiword-Installer.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -[Desktop Entry] -BinaryPattern=kantiword;Kantiword -Exec=kantiword -GenericName=Installer for Kantiword Drag&Drop Icon -GenericName[de]=Installer für Kantiword Drag&Drop Icon -Icon=antiword -Name=Kantiword-Installer -Name[de]=Kantiword-Installer -StartupNotify=true -Terminal=true -Type=Application diff -Nru antiword-0.37/debian/kantiwordrc antiword-0.37/debian/kantiwordrc --- antiword-0.37/debian/kantiwordrc 2011-11-26 12:48:07.000000000 +0000 +++ antiword-0.37/debian/kantiwordrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# -# /home//.kde/share/config/kantiwordrc -# example for Cyrillic environment -# -# value shall match the basename of a mapping file -# in /usr/share/antiword/ -encoding = 8859-5 - -# value PS overrides the default PDF -output_format = PS diff -Nru antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch --- antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch 2016-01-11 22:19:11.000000000 +0000 +++ antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch 2018-11-29 19:28:38.000000000 +0000 @@ -1,10 +1,10 @@ Description: Add check for buffer overflow with malformed input files This was later re-found and became CVE-2014-8123. Author: -Bug-Debian: http://bugs.debian.org/407015 +Bug-Debian: https://bugs.debian.org/407015 Bug-Debian: https://bugs.debian.org/771768 -Forwarded: http://seclists.org/oss-sec/2014/q4/870 -Last-Update: 2016-01-11 +Forwarded: https://seclists.org/oss-sec/2014/q4/870 +Last-Update: 2018-11-30 --- antiword-0.37~/wordole.c 2005-08-26 21:49:57.000000000 +0200 +++ antiword-0.37/wordole.c 2009-06-03 22:31:15.948014682 +0200 diff -Nru antiword-0.37/debian/patches/20_change_bash_to_sh_kantiword.patch antiword-0.37/debian/patches/20_change_bash_to_sh_kantiword.patch --- antiword-0.37/debian/patches/20_change_bash_to_sh_kantiword.patch 2011-11-26 13:22:12.000000000 +0000 +++ antiword-0.37/debian/patches/20_change_bash_to_sh_kantiword.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: kantiword needs sh only -Author: -Last-Update: 2009-06-03 - ---- antiword-0.37~/Makefile.Linux 2005-10-29 19:13:15.000000000 +0200 -+++ antiword-0.37/Makefile.Linux 2009-06-03 22:31:49.816406857 +0200 -@@ -78,8 +78,8 @@ - - kantiword: Unix-only/KDE3-only/kantiword.sh - @rm -f $@ -- echo "#!/bin/bash" > $@ -- cat $? >> $@ -+# echo "#!/bin/bash" > $@ -+ cat $? > $@ - @chmod 750 $@ - - .c.o: diff -Nru antiword-0.37/debian/patches/30_kantiword.patch antiword-0.37/debian/patches/30_kantiword.patch --- antiword-0.37/debian/patches/30_kantiword.patch 2011-11-26 13:23:05.000000000 +0000 +++ antiword-0.37/debian/patches/30_kantiword.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ -Description: Improve kantiword scripts and use secure temp files - Closes: #259999, #363428, [CVE-2005-3126] -Author: -Bug-Debian: http://bugs.debian.org/259999 -Bug-Debian: http://bugs.debian.org/363428 -Last-Update: 2009-06-07 - ---- antiword-0.37~/Unix-only/KDE3-only/kantiword.sh 2009-06-07 00:47:17.000000000 +0200 -+++ antiword-0.37/Unix-only/KDE3-only/kantiword.sh 2009-06-07 00:57:27.564012775 +0200 -@@ -3,69 +3,145 @@ - # Script to make drag and drop in KDE possible - #set -x - # -+CONFS=$(kde-config --path config | tr ':' ' ') -+CONF_FILE=kantiwordrc -+mapping= - --if [ $# -lt 2 ] --then -- exit 0 -+# default output format is PDF -+format="-a" -+ext=pdf -+ -+for i in $CONFS; do -+ if [ -r "$i/$CONF_FILE" ]; then -+ ENCODING=$(grep ^encoding "$i/$CONF_FILE" | tr -d '[:blank:]' | cut -d '=' -f 2) -+ if [ -f "/usr/share/antiword/$ENCODING.txt" ]; then -+ mapping="-m $ENCODING.txt" -+ fi -+ FORMAT=$(grep ^output_format "$i/$CONF_FILE" | tr -d '[:blank:]' | cut -d '=' -f 2) -+ if [ "$FORMAT" = "PS" ]; then -+ # switch to output format PS, Cyrillic is better supported -+ format="-p" -+ ext=ps -+ fi -+ break -+ fi -+done -+ -+DESKTOP=$(kde-config --userpath desktop) -+ -+if [ $# -lt 2 ]; then -+ echo "Would you like to install an icon on your Desktop, where you" -+ echo "will be able to drop an *.doc file on to? It will be displayed" -+ echo "as a PDF document or as plain text (if no PDF viewer available)." -+ echo -n "[Y/n]: > " -+ read n -+ if [ "x$n" = "xy" ] || [ "x$n" = "xY" ] || [ "x$n" = "x" ]; then -+ if [ -r /etc/papersize ]; then -+ n=$(cat /etc/papersize) -+ fi -+ if [ "x$n" != "xa4" ] && [ "x$n" != "xletter" ]; then -+ echo -+ echo "Type" -+ echo "'a' for output papersize A4," -+ echo "'l' for letter or" -+ echo "'n' for cancel." -+ echo -n "[a/l/N]: > " -+ read n -+ fi -+ if [ "x$n" = "xa" ] || [ "x$n" = "xa4" ]; then -+ cp -f /usr/share/antiword/kantiword.eu.desktop "$DESKTOP/kantiword.desktop" -+ elif [ "x$n" = "xl" ] || [ "x$n" = "xletter" ]; then -+ cp -f /usr/share/antiword/kantiword.us.desktop "$DESKTOP/kantiword.desktop" -+ fi -+ fi -+ exit 0 - fi - - # Determine the temp directory --if [ -d "$TMPDIR" ] && [ -w "$TMPDIR" ] --then -- tmp_dir=$TMPDIR --elif [ -d "$TEMP" ] && [ -w "$TEMP" ] --then -- tmp_dir=$TEMP -+if [ -d "$TMPDIR" ] && [ -w "$TMPDIR" ]; then -+ tmp_dir="$TMPDIR" -+elif [ -d "$TEMP" ] && [ -w "$TEMP" ]; then -+ tmp_dir="$TEMP" - else -- tmp_dir="/tmp" --fi -+ tmp_dir="/tmp" -+fi - - # Try to create the temp files in a secure way --if [ -x /bin/tempfile ] --then -- out_file=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".ps"` || exit 1 -- err_file=`/bin/tempfile -d "$tmp_dir" -p antiword -s ".err"` -- if [ $? -ne 0 ] -- then -- rm -f "$out_file" -- exit 1 -- fi --elif [ -x /bin/mktemp ] --then -- out_file=`/bin/mktemp -q -p "$tmp_dir" antiword.ps.XXXXXXXXX` || exit 1 -- err_file=`/bin/mktemp -q -p "$tmp_dir" antiword.err.XXXXXXXXX` -- if [ $? -ne 0 ] -- then -- rm -f "$out_file" -- exit 1 -- fi -+if [ -x /bin/tempfile ]; then -+ out_file=$(/bin/tempfile -d "$tmp_dir" -p antiword -s ".$ext") || exit 1 -+ err_file=$(/bin/tempfile -d "$tmp_dir" -p antiword -s ".err") -+ txt_file=$(/bin/tempfile -d "$tmp_dir" -p antiword -s ".txt") -+ if [ $? -ne 0 ]; then -+ rm -f "$out_file" -+ exit 1 -+ fi -+elif [ -x /bin/mktemp ]; then -+ out_file=$(/bin/mktemp -q -p "$tmp_dir" antiword.$ext.XXXXXXXXX) || exit 1 -+ err_file=$(/bin/mktemp -q -p "$tmp_dir" antiword.err.XXXXXXXXX) -+ txt_file=$(/bin/mktemp -q -p "$tmp_dir" antiword.txt.XXXXXXXXX) -+ if [ $? -ne 0 ]; then -+ rm -f "$out_file" -+ exit 1 -+ fi - else -- # Creating the temp files in an un-secure way -- out_file=$tmp_dir"/antiword.$$.ps" -- err_file=$tmp_dir"/antiword.$$.err" -+ # Creating the temp files in an un-secure way -+ out_file="$tmp_dir/antiword.$$.$ext" -+ err_file="$tmp_dir/antiword.$$.err" -+ txt_file="$tmp_dir/antiword.$$.txt" - fi - --# Determine the paper size --paper_size=$1 --shift -+error=0 -+# filename is empty, user had clicked on icon, so print a help message -+# in err_file -+if [ -z $2 ]; then -+ cat >"$err_file" <"$err_file" >"$out_file" --if [ $? -ne 0 ] --then -- # Something went wrong -- if [ -r "$err_file" ] && [ -s "$err_file" ] -- then -- konsole --caption "Error from Antword" -e less "$err_file" -- fi -- # Clean up -- rm -f "$out_file" "$err_file" -- exit 1 -+EOF -+error=1 -+else -+ # Determine the paper size -+ paper_size=$1 -+ shift -+ -+ # Make the output file (default PDF) -+ antiword $mapping $format $paper_size -i 0 "$@" 2>"$err_file" >"$out_file" -+ if [ $? -ne 0 ]; then -+ error=1 -+ fi -+fi -+if [ $error -ne 0 ]; then -+ # Something went wrong -+ if [ -r "$err_file" ] && [ -s "$err_file" ]; then -+ if [ -x /usr/bin/konsole ]; then -+ /usr/bin/konsole --hold --caption "Error from Antiword" -e more "$err_file" -+ else -+ /usr/bin/X11/xterm -T "Error from Antiword" -e less "$err_file" -+ fi -+ fi -+ # Clean up -+ rm -f "$out_file" "$err_file" "$txt_file" -+ exit 1 - fi - --# Show the PostScript file --gv "$out_file" -nocentre -media $paper_size -+# Show the PDF file -+if [ "$ext" = "pdf" -a -x /usr/bin/kpdf ]; then -+ /usr/bin/kpdf "$out_file" -+elif [ "$ext" = "pdf" -a -x /usr/bin/xpdf ]; then -+ /usr/bin/xpdf "$out_file" -paper=$paper_size -+elif [ -x /usr/bin/gv ]; then -+ /usr/bin/gv "$out_file" --nocenter --media=$paper_size -+else -+ # no viewer available, so display as plain text -+ antiword $mapping "$@" 2>"$err_file" >"$txt_file" -+ if [ -x /usr/bin/konsole ]; then -+ /usr/bin/konsole --hold --caption "Text output from Antiword" -e more "$txt_file" -+ else -+ /usr/bin/X11/xterm -T "Text output from Antiword" -e less "$txt_file" -+ fi -+fi - - # Clean up --rm -f "$out_file" "$err_file" -+rm -f "$out_file" "$err_file" "$txt_file" - exit 0 diff -Nru antiword-0.37/debian/patches/40_desktop_files.patch antiword-0.37/debian/patches/40_desktop_files.patch --- antiword-0.37/debian/patches/40_desktop_files.patch 2011-11-26 13:24:38.000000000 +0000 +++ antiword-0.37/debian/patches/40_desktop_files.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -Description: Extend desktop files -Author: -Last-Update: 2009-06-04 - -diff -urNad antiword-0.37~/Unix-only/KDE3-only/Antiword.desktop.eu antiword-0.37/Unix-only/KDE3-only/Antiword.desktop.eu ---- antiword-0.37~/Unix-only/KDE3-only/Antiword.desktop.eu 2001-07-08 20:45:44.000000000 +0200 -+++ antiword-0.37/Unix-only/KDE3-only/Antiword.desktop.eu 2009-06-04 10:03:59.508015784 +0200 -@@ -1,8 +1,16 @@ - [Desktop Entry] -+Encoding=UTF-8 - BinaryPattern=kantiword;Kantiword --MimeType=application/msword --Name=Antiword -+Comment=*.doc Dateien per Drag&Drop auf das Icon anzeigen -+Comment[de]=*.doc Dateien per Drag&Drop auf das Icon anzeigen -+Comment[en]=displays *.doc files via drag'n'drop on this icon - Exec=kantiword a4 "%f" -+GenericName=Anzeige für MS-Word-Dokument -+GenericName[de]=Anzeige für MS-Word-Dokument -+GenericName[en]=MS-Word document viewer - Icon=antiword -+MimeType=application/msword -+Name=Kantiword -+StartupNotify=false -+Terminal=false - Type=Application --Terminal=0 -diff -urNad antiword-0.37~/Unix-only/KDE3-only/Antiword.desktop.us antiword-0.37/Unix-only/KDE3-only/Antiword.desktop.us ---- antiword-0.37~/Unix-only/KDE3-only/Antiword.desktop.us 2001-07-08 20:45:54.000000000 +0200 -+++ antiword-0.37/Unix-only/KDE3-only/Antiword.desktop.us 2009-06-04 10:03:59.508015784 +0200 -@@ -1,8 +1,16 @@ - [Desktop Entry] -+Encoding=UTF-8 - BinaryPattern=kantiword;Kantiword --MimeType=application/msword --Name=Antiword -+Comment=*.doc Dateien per Drag&Drop auf das Icon anzeigen -+Comment[de]=*.doc Dateien per Drag&Drop auf das Icon anzeigen -+Comment[en]=displays *.doc files via drag'n'drop on this icon - Exec=kantiword letter "%f" -+GenericName=Anzeige für MS-Word-Dokument -+GenericName[de]=Anzeige für MS-Word-Dokument -+GenericName[en]=MS-Word document viewer - Icon=antiword -+MimeType=application/msword -+Name=Kantiword -+StartupNotify=false -+Terminal=false - Type=Application --Terminal=0 diff -Nru antiword-0.37/debian/patches/series antiword-0.37/debian/patches/series --- antiword-0.37/debian/patches/series 2016-01-11 22:37:43.000000000 +0000 +++ antiword-0.37/debian/patches/series 2019-07-31 20:25:58.000000000 +0000 @@ -1,7 +1,5 @@ 10_fix_buffer_overflow_wordole_c.patch -20_change_bash_to_sh_kantiword.patch -30_kantiword.patch -40_desktop_files.patch 50_antiword-manpage-hyphen-to-minus.patch docx.patch remove-cjb.net-references.patch +use-snprintf.patch diff -Nru antiword-0.37/debian/patches/use-snprintf.patch antiword-0.37/debian/patches/use-snprintf.patch --- antiword-0.37/debian/patches/use-snprintf.patch 1970-01-01 00:00:00.000000000 +0000 +++ antiword-0.37/debian/patches/use-snprintf.patch 2018-11-29 19:27:14.000000000 +0000 @@ -0,0 +1,36 @@ +Description: Use snprintf + Use snprintf() when converting dates to strings to make completely sure we + can't overrun the buffer. +Author: Olly Betts +Forwarded: no +Last-Update: 2018-11-29 + +--- antiword-0.37.orig/summary.c ++++ antiword-0.37/summary.c +@@ -729,7 +729,7 @@ szGetLastSaveDtm(void) + if (pTime == NULL) { + return NULL; + } +- sprintf(szTime, "%04d-%02d-%02d", ++ snprintf(szTime, sizeof(szTime), "%04d-%02d-%02d", + pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday); + return szTime; + } /* end of szGetLastSaveDtm */ +@@ -750,7 +750,7 @@ szGetModDate(void) + if (pTime == NULL) { + return NULL; + } +- sprintf(szTime, "D:%04d%02d%02d%02d%02d", ++ snprintf(szTime, sizeof(szTime), "D:%04d%02d%02d%02d%02d", + pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday, + pTime->tm_hour, pTime->tm_min); + return szTime; +@@ -772,7 +772,7 @@ szGetCreationDate(void) + if (pTime == NULL) { + return NULL; + } +- sprintf(szTime, "D:%04d%02d%02d%02d%02d", ++ snprintf(szTime, sizeof(szTime), "D:%04d%02d%02d%02d%02d", + pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday, + pTime->tm_hour, pTime->tm_min); + return szTime; diff -Nru antiword-0.37/debian/rules antiword-0.37/debian/rules --- antiword-0.37/debian/rules 2016-01-11 23:04:43.000000000 +0000 +++ antiword-0.37/debian/rules 2019-07-31 21:09:59.000000000 +0000 @@ -1,6 +1,8 @@ #!/usr/bin/make -f -DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) ifeq ($(origin CC),default) CC = $(DEB_HOST_GNU_TYPE)-gcc @@ -13,6 +15,10 @@ CFLAGS += -DNDEBUG endif +# The source code unpacks structures into variables that then only get used in +# debug builds, which results in a lot of uninteresting warnings. +CFLAGS += -Wno-unused-but-set-variable + %: dh $@ @@ -24,21 +30,8 @@ override_dh_auto_install: $(MAKE) -f Makefile.Linux global_install GLOBAL_INSTALL_DIR=/usr/bin DESTDIR=debian/antiword - - cp -f Unix-only/KDE3-only/Antiword.desktop.eu \ - debian/antiword/usr/share/antiword/kantiword.eu.desktop - cp -f Unix-only/KDE3-only/Antiword.desktop.us \ - debian/antiword/usr/share/antiword/kantiword.us.desktop - cp -f debian/Kantiword-Installer.desktop \ - debian/antiword/usr/share/applnk/Utilities/ - cp -f Unix-only/KDE3-only/lo16-app-antiword.png \ - debian/antiword/usr/share/icons/locolor/16x16/apps/antiword.png - cp -f Unix-only/KDE3-only/lo32-app-antiword.png \ - debian/antiword/usr/share/icons/locolor/32x32/apps/antiword.png - cp -f Unix-only/KDE3-only/hi32-app-antiword.png \ - debian/antiword/usr/share/icons/hicolor/32x32/apps/antiword.png - cp -f Unix-only/KDE3-only/hi48-app-antiword.png \ - debian/antiword/usr/share/icons/hicolor/48x48/apps/antiword.png + # Don't ship kantiword - it's broken and apparently unused. + rm -f debian/antiword/usr/bin/kantiword mkdir -p debian/antiword/usr/share/doc/antiword cp -f Docs/History debian/antiword/usr/share/doc/antiword/TODO diff -Nru antiword-0.37/debian/tests/control antiword-0.37/debian/tests/control --- antiword-0.37/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ antiword-0.37/debian/tests/control 2018-11-28 20:21:31.000000000 +0000 @@ -0,0 +1 @@ +Tests: smoke diff -Nru antiword-0.37/debian/tests/smoke antiword-0.37/debian/tests/smoke --- antiword-0.37/debian/tests/smoke 1970-01-01 00:00:00.000000000 +0000 +++ antiword-0.37/debian/tests/smoke 2018-11-29 19:16:54.000000000 +0000 @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +echo "*** Testing extracted text matches expected version" +antiword Docs/testdoc.doc | diff debian/tests/testdoc.expected.txt - diff -Nru antiword-0.37/debian/tests/testdoc.expected.txt antiword-0.37/debian/tests/testdoc.expected.txt --- antiword-0.37/debian/tests/testdoc.expected.txt 1970-01-01 00:00:00.000000000 +0000 +++ antiword-0.37/debian/tests/testdoc.expected.txt 2018-11-28 20:21:13.000000000 +0000 @@ -0,0 +1,22 @@ + + +This is just a small test document. + + +This is just a small document to see if Antiword has been compiled +correctly. +The images will only show in the PostScript mode. + +[pic] + +Figure 1 + +This JPEG image is the Antiword icon. + +[pic] + +Figure 2 + +This PNG image is the cover of the O’Reilly book about PNG. +NOTE: this image only shown correctly when Antiword is run with the “-i 0” +option.