Index: head/print/a2ps/files/patch-contrib-emacs-Makefile.in =================================================================== --- head/print/a2ps/files/patch-contrib-emacs-Makefile.in (revision 432055) +++ head/print/a2ps/files/patch-contrib-emacs-Makefile.in (revision 432056) @@ -1,25 +1,24 @@ -Index: contrib/emacs/Makefile.in ---- contrib/emacs/Makefile.in.orig 2011-09-27 15:17:26.000000000 +0900 -+++ contrib/emacs/Makefile.in 2011-09-27 15:18:10.000000000 +0900 -@@ -159,8 +159,9 @@ +--- contrib/emacs/Makefile.in.orig 2000-02-24 18:01:08 UTC ++++ contrib/emacs/Makefile.in +@@ -159,8 +159,9 @@ Makefile: $(srcdir)/Makefile.in $(top_b install-dist_lispLISP: $(dist_lisp_LISP) $(ELCFILES) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(lispdir) - @list='$(dist_lisp_LISP)'; for p in $$list; do \ + if test $(EMACS) != no; then \ + $(mkinstalldirs) $(DESTDIR)$(lispdir); \ + list='$(dist_lisp_LISP)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(lispdir)/$$f"; \ -@@ -169,7 +170,8 @@ +@@ -169,7 +170,8 @@ install-dist_lispLISP: $(dist_lisp_LISP) echo " $(INSTALL_DATA) $${p}c $(DESTDIR)$(lispdir)/$${f}c"; \ $(INSTALL_DATA) $${p}c $(DESTDIR)$(lispdir)/$${f}c; \ else : ; fi; \ - done + done; \ + fi uninstall-dist_lispLISP: @$(NORMAL_UNINSTALL) Index: head/print/a2ps/files/patch-contrib-tmpdircreation =================================================================== --- head/print/a2ps/files/patch-contrib-tmpdircreation (revision 432055) +++ head/print/a2ps/files/patch-contrib-tmpdircreation (revision 432056) @@ -1,116 +1,116 @@ diff -ru contrib.orig/card.in contrib/card.in ---- contrib.orig/card.in Thu Dec 30 19:23:25 2004 -+++ contrib/card.in Thu Dec 30 19:29:49 2004 +--- contrib.orig/card.in 2000-01-27 00:42:36 UTC ++++ contrib/card.in @@ -38,7 +38,7 @@ LC_ALL="${LC_ALL-C}" export LC_ALL print_form_feeds=: RM="/bin/rm -rf" -tmp_dir=${TMPDIR-/tmp}/$program.$$ +tmp_dir=$(mktemp -d -t ${program}) || exit 1 tmp_file=$tmp_dir/card success=false verbose=: @@ -190,7 +190,6 @@ # Create a tmp dir and be ready to clean up trap "$RM $tmp_dir" 0 1 2 15 -(umask 077 && mkdir $tmp_dir) || exit 1 case $LC_ALL in fr) footer="Engendré par $version_short" ;; diff -ru contrib.orig/fixps.in contrib/fixps.in ---- contrib.orig/fixps.in Thu Dec 30 19:23:25 2004 -+++ contrib/fixps.in Thu Dec 30 19:31:22 2004 +--- contrib.orig/fixps.in 2000-02-21 08:16:15 UTC ++++ contrib/fixps.in @@ -38,7 +38,7 @@ run_gs=0 # What action to perform: fixps, cat, check, and gs task=fixps -tmpdir=/tmp/$program.$$ +tmpdir=$(mktemp -d -t ${program}) || exit 1 verbose=echo # The version/usage strings @@ -191,7 +191,6 @@ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15 fi -mkdir $tmpdir fixps_sed=$tmpdir/fixps.sed # If printing from stdin, save into a tmp file diff -ru contrib.orig/pdiff.in contrib/pdiff.in ---- contrib.orig/pdiff.in Thu Dec 30 19:23:25 2004 -+++ contrib/pdiff.in Thu Dec 30 19:16:59 2004 +--- contrib.orig/pdiff.in 1999-10-24 15:07:51 UTC ++++ contrib/pdiff.in @@ -34,7 +34,7 @@ diff_options='-u' file= output= -tmpdir=/tmp/$program.$$ +tmpdir=$(mktemp -d -t ${program}) || exit 1 verbose=echo wdiff_prog=${WDIFF:-wdiff} wdiff_options='-w[wd- -x-wd] -y{wd+ -z+wd}' diff -ru contrib.orig/psmandup.in contrib/psmandup.in ---- contrib.orig/psmandup.in Thu Dec 30 19:23:25 2004 -+++ contrib/psmandup.in Thu Dec 30 19:32:30 2004 +--- contrib.orig/psmandup.in 1999-10-24 13:06:42 UTC ++++ contrib/psmandup.in @@ -36,7 +36,7 @@ message= psselect=${PSSELECT:-psselect} psset=${PSSET:-psset} -tmpdir=/tmp/$program.$$ +tmpdir=$(mktemp -d -t ${program}) || exit 1 # These two must be kept in synch. They are opposed. verbose=echo @@ -184,8 +184,6 @@ # Temp dir. Get ready not to leave junk (if not debugging) trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15 fi - -mkdir $tmpdir # If printing from stdin, save into a tmp file if test $file = '-'; then diff -ru contrib.orig/psset.in contrib/psset.in ---- contrib.orig/psset.in Thu Dec 30 19:23:25 2004 -+++ contrib/psset.in Thu Dec 30 19:33:50 2004 +--- contrib.orig/psset.in 1999-10-24 12:41:46 UTC ++++ contrib/psset.in @@ -33,7 +33,7 @@ output=- pagedevices= # `;' separated list of `key:value' quiet=: # i.e., verbose -tmpdir=${TMPDIR:-/tmp}/$program.$$ +tmpdir=$(mktemp -d -t ${program}) || exit 1 sedscript=$tmpdir/psset.sed # The version/usage strings @@ -185,8 +185,6 @@ echo "$help" 1>&2 exit 1;; esac - -mkdir $tmpdir if test -n "$debug"; then # Set -x now if debugging diff -ru contrib.orig/texi2dvi4a2ps contrib/texi2dvi4a2ps ---- contrib.orig/texi2dvi4a2ps Thu Dec 30 19:23:25 2004 -+++ contrib/texi2dvi4a2ps Thu Dec 30 19:34:36 2004 +--- contrib.orig/texi2dvi4a2ps 2000-02-24 17:45:31 UTC ++++ contrib/texi2dvi4a2ps @@ -91,7 +91,7 @@ quiet= # by default let the tools' message be displayed set_language= textra= -tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems. +tmpdir=$(mktemp -d -t ${program}) || exit 1 txincludes= # TEXINPUTS extensions txiprereq=19990129 # minimum texinfo.tex version to have macro expansion verbose=false # echo for verbose mode @@ -202,9 +202,6 @@ if test -z "$debug"; then trap "cd / && rm -rf $tmpdir" 0 1 2 15 fi - -# Create the temporary directory with strict rights -(umask 077 && mkdir $tmpdir) || exit 1 # Prepare the tools we might need. This may be extra work in some # cases, but improves the readibility of the script. Index: head/print/a2ps/files/patch-etc-Makefile.in =================================================================== --- head/print/a2ps/files/patch-etc-Makefile.in (revision 432055) +++ head/print/a2ps/files/patch-etc-Makefile.in (revision 432056) @@ -1,11 +1,11 @@ ---- etc/Makefile.in.orig Tue Nov 20 19:09:45 2001 -+++ etc/Makefile.in Tue Nov 20 19:09:53 2001 -@@ -131,7 +131,7 @@ +--- etc/Makefile.in.orig 2000-02-24 17:55:34 UTC ++++ etc/Makefile.in +@@ -131,7 +131,7 @@ l = @l@ lispdir = @lispdir@ -ogonkifydir = $(datadir)/ogonkify +ogonkifydir = $(datadir)/a2ps/ogonkify libpath = $(pkgdatadir)/sheets:$(pkgdatadir)/ps:$(pkgdatadir)/encoding:$(pkgdatadir)/afm:$(ogonkifydir)/afm:$(pkgdatadir)/ppd:$(pkgdatadir)/fonts:$(ogonkifydir)/fonts:$(pkgdatadir) pkgdata_DATA = README Index: head/print/a2ps/files/patch-localealias.c =================================================================== --- head/print/a2ps/files/patch-localealias.c (revision 432055) +++ head/print/a2ps/files/patch-localealias.c (revision 432056) @@ -1,20 +1,20 @@ ---- intl/localealias.c.orig Tue Aug 31 13:29:35 1999 -+++ intl/localealias.c Tue Aug 12 11:09:53 2003 -@@ -329,6 +329,17 @@ +--- intl/localealias.c.orig 1999-08-31 17:29:35 UTC ++++ intl/localealias.c +@@ -329,6 +329,17 @@ read_alias_file (fname, fname_len) FREE_BLOCKS (block_list); return added; } + if (string_space != new_pool) + { + size_t i; + + for (i = 0; i < nmap; i++) + { + map[i].alias += new_pool - string_space; + map[i].value += new_pool - string_space; + } + } + string_space = new_pool; string_space_max = new_size; } Index: head/print/a2ps/files/patch-ogonkify-Makefile.in =================================================================== --- head/print/a2ps/files/patch-ogonkify-Makefile.in (revision 432055) +++ head/print/a2ps/files/patch-ogonkify-Makefile.in (revision 432056) @@ -1,11 +1,11 @@ ---- ogonkify/Makefile.in.orig Tue Apr 20 00:07:03 1999 -+++ ogonkify/Makefile.in Tue Apr 20 00:07:07 1999 -@@ -37,7 +37,7 @@ +--- ogonkify/Makefile.in.orig 2000-01-07 13:00:49 UTC ++++ ogonkify/Makefile.in +@@ -33,7 +33,7 @@ mandir = @mandir@ DESTDIR = -pkgdatadir = $(datadir)/@PACKAGE@ +pkgdatadir = $(datadir)/a2ps/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ Index: head/print/a2ps/files/patch-options.c =================================================================== --- head/print/a2ps/files/patch-options.c (revision 432055) +++ head/print/a2ps/files/patch-options.c (revision 432056) @@ -1,18 +1,18 @@ ---- lib/options.c.orig Thu Sep 21 23:22:36 2000 -+++ lib/options.c Thu Sep 21 23:22:42 2000 -@@ -493,6 +493,15 @@ +--- lib/options.c.orig 1999-08-31 17:42:41 UTC ++++ lib/options.c +@@ -493,6 +493,15 @@ a2ps_handle_options (a2ps_job * job, int /* A font size is given */ job->fontsize = get_length ("--font-size", cp, 0.0, 0.0, "pt", range_min_strict); + if (job->fontsize == 0.0) + { + error (0, 0, _("invalid argument %s for -f or --font-size option"), + cp); + fprintf (stderr, + _("Valid arguments are floats with optonal units!\n")); + fprintf (stderr, _("Try `a2ps --help' for more information.\n")); + exit (EXIT_FAILURE); + } job->columns_requested = 0; job->lines_requested = 0; } Index: head/print/a2ps/files/patch-output.c =================================================================== --- head/print/a2ps/files/patch-output.c (revision 432055) +++ head/print/a2ps/files/patch-output.c (revision 432056) @@ -1,13 +1,13 @@ Fix for CVE-2015-8107 http://www.openwall.com/lists/oss-security/2015/11/16/4 ---- lib/output.c.orig 1999-08-31 19:42:41.000000000 +0200 +--- lib/output.c.orig 1999-08-31 17:42:41 UTC +++ lib/output.c 2015-11-18 07:08:31.672864000 +0100 @@ -525,7 +525,7 @@ expand_user_string (job, FIRST_FILE (job), (const uchar *) "Expand: requirement", (const uchar *) token)); - output (dest, expansion); + output (dest, "%s", expansion); continue; } Index: head/print/a2ps/files/patch-printers.c =================================================================== --- head/print/a2ps/files/patch-printers.c (revision 432055) +++ head/print/a2ps/files/patch-printers.c (revision 432056) @@ -1,13 +1,13 @@ ---- lib/printers.c.orig Tue Oct 12 00:01:59 1999 -+++ lib/printers.c Wed May 2 11:23:25 2001 -@@ -315,8 +315,8 @@ +--- lib/printers.c.orig 1999-10-11 22:01:59 UTC ++++ lib/printers.c +@@ -315,8 +315,8 @@ a2ps_printers_new (struct a2ps_common_s res->ppd = NULL; /* Printer's ppd are not read yet */ /* Output */ - /* Default is to send to default printer */ - res->flag_output_is_printer = true; + /* Default is to send to stdout */ + res->flag_output_is_printer = false; res->flag_output_name = NULL; res->output_is_file = true; res->output_name = NULL; Index: head/print/a2ps/files/patch-select.c =================================================================== --- head/print/a2ps/files/patch-select.c (revision 432055) +++ head/print/a2ps/files/patch-select.c (revision 432056) @@ -1,57 +1,57 @@ ---- src/select.c.orig Thu Dec 16 02:04:56 1999 -+++ src/select.c Sat Aug 21 12:05:31 2004 -@@ -131,6 +131,36 @@ +--- src/select.c.orig 1999-12-16 01:04:56 UTC ++++ src/select.c +@@ -131,6 +131,36 @@ sheets_map_load_main (void) return 1; } +/* escapes the name of a file so that the shell groks it in 'single' q.marks. + The resulting pointer has to be free()ed when not longer used. */ +char * +shell_escape(const char *fn) +{ + size_t len = 0; + const char *inp; + char *retval, *outp; + + for(inp = fn; *inp; ++inp) + switch(*inp) + { + case '\'': len += 4; break; + default: len += 1; break; + } + + outp = retval = malloc(len + 1); + if(!outp) + return NULL; /* perhaps one should do better error handling here */ + for(inp = fn; *inp; ++inp) + switch(*inp) + { + case '\'': *outp++ = '\''; *outp++ = '\\'; *outp++ = '\'', *outp++ = '\''; break; + default: *outp++ = *inp; break; + } + *outp = 0; + + return retval; +} + /* What says file about the type of a file (result is malloc'd). NULL if could not be run. */ -@@ -144,11 +174,15 @@ +@@ -144,11 +174,15 @@ file_verdict_on (const uchar *filename) if (IS_EMPTY (job->file_command)) return NULL; + filename = shell_escape(filename); + if(filename == NULL) + return NULL; /* Call file(1) with the correct option */ - command = ALLOCA (char, (2 + command = ALLOCA (char, (4 + strlen (job->file_command) + ustrlen (filename))); - sprintf (command, "%s %s", job->file_command, (const char *) filename); + sprintf (command, "%s '%s'", job->file_command, (const char *) filename); + free(filename); message (msg_tool, (stderr, "Reading pipe: `%s'\n", command)); file_out = popen (command, "r"); Index: head/print/a2ps/files/patch-title.c =================================================================== --- head/print/a2ps/files/patch-title.c (revision 432055) +++ head/print/a2ps/files/patch-title.c (revision 432056) @@ -1,11 +1,11 @@ ---- lib/title.c.orig 2015-09-25 08:26:23 UTC +--- lib/title.c.orig 1999-08-28 16:54:19 UTC +++ lib/title.c @@ -88,6 +88,8 @@ title (stream, c, center_p, format, va_a if (center_p) for (padding = 0 ; padding < 79 - len ; padding += 2) putc (' ', stream); + va_end(args); + VA_START(args, format); # if HAVE_VPRINTF || _LIBC vfprintf (stream, format, args); # else Index: head/print/a2ps/files/patch-xgethostname.c =================================================================== --- head/print/a2ps/files/patch-xgethostname.c (revision 432055) +++ head/print/a2ps/files/patch-xgethostname.c (revision 432056) @@ -1,28 +1,28 @@ ---- lib/xgethostname.c.orig Tue Sep 4 00:51:26 2001 -+++ lib/xgethostname.c Tue Sep 4 00:55:39 2001 +--- lib/xgethostname.c.orig 1999-08-28 17:11:35 UTC ++++ lib/xgethostname.c @@ -21,6 +21,7 @@ # include #endif +#include #include #include -@@ -38,7 +39,7 @@ +@@ -38,7 +39,7 @@ extern int errno; int gethostname (); #ifndef INITIAL_HOSTNAME_LENGTH -# define INITIAL_HOSTNAME_LENGTH 34 +# define INITIAL_HOSTNAME_LENGTH MAXHOSTNAMELEN #endif char * -@@ -63,7 +64,7 @@ +@@ -63,7 +64,7 @@ xgethostname () if (err == 0 && hostname[k] == '\0') break; #ifdef ENAMETOOLONG - else if (err != 0 && errno != ENAMETOOLONG && errno != 0) + else if (err != 0 && errno != ENAMETOOLONG && errno != ENOMEM && errno != 0) error (EXIT_FAILURE, errno, "gethostname"); #endif size *= 2;