long overdue maintenance update to 1.6.6; ok jeremy@

This commit is contained in:
naddy 2015-07-20 00:50:27 +00:00
parent 6737e52a95
commit 49798c21da
12 changed files with 35 additions and 403 deletions

View File

@ -1,24 +1,23 @@
# $OpenBSD: Makefile,v 1.32 2015/05/02 09:39:05 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.33 2015/07/20 00:50:27 naddy Exp $
COMMENT= convert ASCII files to PostScript
DISTNAME= enscript-1.6.3
REVISION= 4
DISTNAME= enscript-1.6.6
CATEGORIES= print
HOMEPAGE= http://www.codento.com/people/mtr/genscript/
HOMEPAGE= https://www.gnu.org/software/enscript/
# GPLv2
# GPLv3
PERMIT_PACKAGE_CDROM= Yes
WANTLIB += c m
MASTER_SITES= ${MASTER_SITE_GNU:=enscript/}
MASTER_SITES= ${HOMEPAGE} \
${MASTER_SITE_GNU:=enscript/}
MODULES= devel/gettext
WANTLIB= c m
CONFIGURE_STYLE= gnu
# gettext detection is broken and the translations are severely lacking
CONFIGURE_ARGS= --disable-nls
USE_GROFF = Yes
FAKE_FLAGS= sysconfdir=${TRUEPREFIX}/share/examples/enscript
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (enscript-1.6.3.tar.gz) = Z4w9YmXs6xQKugRvQEyTXTGIE67NCxzesBKbCcmw3wA=
SIZE (enscript-1.6.3.tar.gz) = 814308
SHA256 (enscript-1.6.6.tar.gz) = bVa62mk00FWzS2yQOZqoWXXmZFesW/UTQnrn/Hf1wLs=
SIZE (enscript-1.6.6.tar.gz) = 1330493

View File

@ -1,22 +0,0 @@
$OpenBSD: patch-afm_Makefile_in,v 1.2 2008/12/09 15:23:55 jasper Exp $
--- afm/Makefile.in.orig Thu Jan 24 08:39:24 2002
+++ afm/Makefile.in Tue Dec 9 16:23:25 2008
@@ -227,14 +227,14 @@ maintainer-clean-generic clean mostlyclean distclean m
install-data-local:
- $(top_srcdir)/mkinstalldirs $(datadir)/enscript
- $(top_srcdir)/mkinstalldirs $(datadir)/enscript/afm
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/enscript
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/enscript/afm
for f in $(EXTRA_DIST); do \
- $(INSTALL_DATA) $(srcdir)/$$f $(datadir)/enscript/afm/$$f; \
+ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(datadir)/enscript/afm/$$f; \
done
uninstall-local:
- rm -rf $(datadir)/enscript/afm
+ rm -rf $(DESTDIR)$(datadir)/enscript/afm
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-lib-Makefile_in,v 1.3 2005/02/11 17:57:31 naddy Exp $
--- lib/Makefile.in.orig Thu Jan 24 02:39:27 2002
+++ lib/Makefile.in Sat May 11 11:03:21 2002
@@ -254,12 +254,8 @@ mostlyclean distclean maintainer-clean
all-local: enscript.cfg
install-data-local: enscript.cfg
- $(top_srcdir)/mkinstalldirs $(sysconfdir)
- if test -r $(sysconfdir)/enscript.cfg; then \
- cp $(sysconfdir)/enscript.cfg $(sysconfdir)/enscript.cfg.old; \
- else :; \
- fi
- $(INSTALL_DATA) enscript.cfg $(sysconfdir)/enscript.cfg
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/examples/enscript
+ $(INSTALL_DATA) enscript.cfg $(DESTDIR)$(datadir)/examples/enscript/enscript.cfg-sample
uninstall-local:
rm -f $(sysconfdir)/enscript.cfg

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-po-Makefile_in_in,v 1.3 2005/02/11 17:57:31 naddy Exp $
--- po/Makefile.in.in.orig Tue Dec 8 02:08:18 1998
+++ po/Makefile.in.in Sat May 11 11:04:02 2002
@@ -111,16 +111,16 @@ install-data: install-data-@USE_NLS@
install-data-no: all
install-data-yes: all
if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(datadir); \
+ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
fi
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
case "$$cat" in \
- *.gmo) destdir=$(gnulocaledir);; \
- *) destdir=$(localedir);; \
+ *.gmo) destdir=$(DESTDIR)$(gnulocaledir);; \
+ *) destdir=$(DESTDIR)$(localedir);; \
esac; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-src_gsint_h,v 1.2 2008/12/09 15:23:55 jasper Exp $
--- src/gsint.h.orig Tue Jul 11 17:28:06 2000
+++ src/gsint.h Tue Dec 9 16:23:25 2008
@@ -701,4 +701,9 @@ FILE *printer_open ___P ((char *cmd, char *options, ch
*/
void printer_close ___P ((void *context));
+/*
+ * Escape filenames for shell usage
+ */
+char *shell_escape ___P ((const char *fn));
+
#endif /* not GSINT_H */

View File

@ -1,46 +0,0 @@
$OpenBSD: patch-src_main_c,v 1.2 2008/12/09 15:23:55 jasper Exp $
--- src/main.c.orig Thu Jan 24 08:35:45 2002
+++ src/main.c Tue Dec 9 16:23:25 2008
@@ -1546,9 +1546,13 @@ name width\theight\tllx\tlly\turx\tury\n\
buffer_append (&cmd, intbuf);
buffer_append (&cmd, " ");
- buffer_append (&cmd, "-Ddocument_title=\"");
- buffer_append (&cmd, title);
- buffer_append (&cmd, "\" ");
+ buffer_append (&cmd, "-Ddocument_title=\'");
+ if ((cp = shell_escape (title)) != NULL)
+ {
+ buffer_append (&cmd, cp);
+ free (cp);
+ }
+ buffer_append (&cmd, "\' ");
buffer_append (&cmd, "-Dtoc=");
buffer_append (&cmd, toc ? "1" : "0");
@@ -1565,8 +1569,14 @@ name width\theight\tllx\tlly\turx\tury\n\
/* Append input files. */
for (i = optind; i < argc; i++)
{
- buffer_append (&cmd, " ");
- buffer_append (&cmd, argv[i]);
+ char *cp;
+ if ((cp = shell_escape (argv[i])) != NULL)
+ {
+ buffer_append (&cmd, " \'");
+ buffer_append (&cmd, cp);
+ buffer_append (&cmd, "\'");
+ free (cp);
+ }
}
/* And do the job. */
@@ -1627,7 +1637,7 @@ name width\theight\tllx\tlly\turx\tury\n\
buffer_ptr (opts), buffer_len (opts));
}
- buffer_append (&buffer, " \"%s\"");
+ buffer_append (&buffer, " \'%s\'");
input_filter = buffer_copy (&buffer);
input_filter_stdin = "-";

View File

@ -1,128 +0,0 @@
$OpenBSD: patch-src_psgen_c,v 1.3 2008/12/09 16:00:18 jasper Exp $
Among the changes in this patch are security fixes for CVE-2008-3863
and CVE-2008-4306 . Patch by Werner Fink, Debian #506261
--- src/psgen.c.orig Thu Jan 24 08:38:58 2002
+++ src/psgen.c Tue Dec 9 16:54:50 2008
@@ -24,6 +24,7 @@
* Boston, MA 02111-1307, USA.
*/
+#include <limits.h>
#include "gsint.h"
/*
@@ -124,7 +125,7 @@ struct gs_token_st
double xscale;
double yscale;
int llx, lly, urx, ury; /* Bounding box. */
- char filename[512];
+ char filename[PATH_MAX];
char *skipbuf;
unsigned int skipbuf_len;
unsigned int skipbuf_pos;
@@ -135,11 +136,11 @@ struct gs_token_st
Color bgcolor;
struct
{
- char name[512];
+ char name[PATH_MAX];
FontPoint size;
InputEncoding encoding;
} font;
- char filename[512];
+ char filename[PATH_MAX];
} u;
};
@@ -248,7 +249,7 @@ static int do_print = 1;
static int user_fontp = 0;
/* The user ^@font{}-defined font. */
-static char user_font_name[256];
+static char user_font_name[PATH_MAX];
static FontPoint user_font_pt;
static InputEncoding user_font_encoding;
@@ -978,7 +979,8 @@ large for page\n"),
FATAL ((stderr,
_("user font encoding can be only the system's default or `ps'")));
- strcpy (user_font_name, token.u.font.name);
+ memset (user_font_name, 0, sizeof(user_font_name));
+ strncpy (user_font_name, token.u.font.name, sizeof(user_font_name) - 1);
user_font_pt.w = token.u.font.size.w;
user_font_pt.h = token.u.font.size.h;
user_font_encoding = token.u.font.encoding;
@@ -1444,7 +1446,7 @@ read_special_escape (InputStream *is, Token *token)
buf[i] = ch;
if (i + 1 >= sizeof (buf))
FATAL ((stderr, _("too long argument for %s escape:\n%.*s"),
- escapes[i].name, i, buf));
+ escapes[e].name, i, buf));
}
buf[i] = '\0';
@@ -1452,7 +1454,8 @@ read_special_escape (InputStream *is, Token *token)
switch (escapes[e].escape)
{
case ESC_FONT:
- strcpy (token->u.font.name, buf);
+ memset (token->u.font.name, 0, sizeof(token->u.font.name));
+ strncpy (token->u.font.name, buf, sizeof(token->u.font.name) - 1);
/* Check for the default font. */
if (strcmp (token->u.font.name, "default") == 0)
@@ -1465,7 +1468,8 @@ read_special_escape (InputStream *is, Token *token)
FATAL ((stderr, _("malformed font spec for ^@font escape: %s"),
token->u.font.name));
- strcpy (token->u.font.name, cp);
+ memset (token->u.font.name, 0, sizeof(token->u.font.name));
+ strncpy (token->u.font.name, cp, sizeof(token->u.font.name) - 1);
xfree (cp);
}
token->type = tFONT;
@@ -1544,7 +1548,8 @@ read_special_escape (InputStream *is, Token *token)
break;
case ESC_SETFILENAME:
- strcpy (token->u.filename, buf);
+ memset (token->u.filename, 0, sizeof(token->u.font.name));
+ strncpy (token->u.filename, buf, sizeof(token->u.filename) - 1);
token->type = tSETFILENAME;
break;
@@ -2034,8 +2039,9 @@ dump_ps_page_header (char *fname, int empty)
else
{
ftail++;
- strncpy (buf, fname, ftail - fname);
- buf[ftail - fname] = '\0';
+ i = ftail - fname >= sizeof (buf)-1 ? sizeof (buf)-1 : ftail - fname;
+ strncpy (buf, fname, i);
+ buf[i] = '\0';
}
if (nup > 1)
@@ -2385,9 +2391,10 @@ recognize_eps_file (Token *token)
MESSAGE (2, (stderr, "^@epsf=\"%s\"\n", token->u.epsf.filename));
i = strlen (token->u.epsf.filename);
+ /*
if (i > 0 && token->u.epsf.filename[i - 1] == '|')
{
- /* Read EPS data from pipe. */
+ / * Read EPS data from pipe. * /
token->u.epsf.pipe = 1;
token->u.epsf.filename[i - 1] = '\0';
token->u.epsf.fp = popen (token->u.epsf.filename, "r");
@@ -2400,6 +2407,7 @@ recognize_eps_file (Token *token)
}
}
else
+ */
{
char *filename;

View File

@ -1,80 +0,0 @@
$OpenBSD: patch-src_util_c,v 1.2 2008/12/09 15:23:55 jasper Exp $
--- src/util.c.orig Fri Sep 17 17:26:51 1999
+++ src/util.c Tue Dec 9 16:23:25 2008
@@ -1239,6 +1239,8 @@ escape_string (char *string)
/* Create result. */
cp = xmalloc (len + 1);
+ if (cp == NULL)
+ return NULL;
for (i = 0, j = 0; string[i]; i++)
switch (string[i])
{
@@ -1879,6 +1881,7 @@ is_open (InputStream *is, FILE *fp, char *fname, char
char *cmd = NULL;
int cmdlen;
int i, pos;
+ char *cp;
is->is_pipe = 1;
@@ -1902,12 +1905,16 @@ is_open (InputStream *is, FILE *fp, char *fname, char
{
case 's':
/* Expand cmd-buffer. */
- cmdlen += strlen (fname);
- cmd = xrealloc (cmd, cmdlen);
+ if ((cp = shell_escape (fname)) != NULL)
+ {
+ cmdlen += strlen (cp);
+ cmd = xrealloc (cmd, cmdlen);
- /* Paste filename. */
- strcpy (cmd + pos, fname);
- pos += strlen (fname);
+ /* Paste filename. */
+ strcpy (cmd + pos, cp);
+ pos += strlen (cp);
+ free (cp);
+ }
i++;
break;
@@ -2115,4 +2122,37 @@ size_t
buffer_len (Buffer *buffer)
{
return buffer->len;
+}
+
+/*
+ * Escapes the name of a file so that the shell groks it in 'single'
+ * quotation 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;
}

View File

@ -1,22 +0,0 @@
$OpenBSD: patch-states_hl_Makefile_in,v 1.2 2008/12/09 15:23:55 jasper Exp $
--- states/hl/Makefile.in.orig Thu Jan 24 08:39:40 2002
+++ states/hl/Makefile.in Tue Dec 9 16:23:25 2008
@@ -234,14 +234,14 @@ maintainer-clean-generic clean mostlyclean distclean m
install-data-local:
- $(top_srcdir)/mkinstalldirs $(datadir)/enscript
- $(top_srcdir)/mkinstalldirs $(datadir)/enscript/hl
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/enscript
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir)/enscript/hl
for f in $(states); do \
- $(INSTALL_DATA) $(srcdir)/$$f $(datadir)/enscript/hl/$$f; \
+ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(datadir)/enscript/hl/$$f; \
done
uninstall-local:
- rm -rf $(datadir)/enscript/hl
+ rm -rf $(DESTDIR)$(datadir)/enscript/hl
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,33 +1,4 @@
GNU enscript is a drop-in replacement for the enscript program.
Enscript converts ASCII files to PostScript and stores generated
output to a file or sends it directly to the printer.
Enscript supports following character sets:
- ISO-8859-1 ISO Latin1 (default)
- ISO-8859-2 ISO Latin2
- ISO-8859-3 ISO Latin3
- ISO-8859-4 ISO Latin4
- ISO-8859-5 ISO Cyrillic
- ISO-8859-7 ISO Greek
- ascii 7 bit ascii
- ascii fi se 7 bit ascii with following encodings:
'{' = adieresis
'|' = odieresis
'}' = aring
'[' = Adieresis
'\' = Odieresis
']' = Aring
- ascii dk no 7 bit ascii with following encodings:
'{' = ae
'|' = oslash
'}' = aring
'[' = AE
'\' = Oslash
']' = Aring
- IBM/PC standard PC/DOS character set
- Mac Macintosh character set
- VMS VMS multinational charset
- hp8 HP Roman-8 charset
- koi8 Adobe Standard Cyrillic Font KOI8 charset
- ps PostScript font's default encoding
- pslatin1 PostScript interpreter's `ISOLatin1Encoding'
GNU Enscript converts ASCII files to PostScript, HTML, or RTF and stores
generated output to a file or sends it directly to the printer. It includes
features for "pretty-printing" (language-sensitive code highlighting) in
several programming languages.

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.11 2013/11/02 09:02:56 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.12 2015/07/20 00:50:27 naddy Exp $
@pkgpath print/enscript,a4
bin/diffpp
@bin bin/enscript
@ -22,6 +22,7 @@ share/enscript/88597.enc
share/enscript/88599.enc
share/enscript/a2ps.hdr
share/enscript/afm/
share/enscript/afm/MustRead.html
share/enscript/afm/agd.afm
share/enscript/afm/agdo.afm
share/enscript/afm/agw.afm
@ -93,6 +94,7 @@ share/enscript/hl/diffs.st
share/enscript/hl/diffu.st
share/enscript/hl/elisp.st
share/enscript/hl/enscript.st
share/enscript/hl/f90.st
share/enscript/hl/fortran.st
share/enscript/hl/fortran_pp.st
share/enscript/hl/haskell.st
@ -111,10 +113,7 @@ share/enscript/hl/lang_texinfo.st
share/enscript/hl/m4.st
share/enscript/hl/mail.st
share/enscript/hl/makefile.st
share/enscript/hl/maple.st
share/enscript/hl/matlab.st
share/enscript/hl/modula_2.st
share/enscript/hl/nested.st
share/enscript/hl/nroff.st
share/enscript/hl/objc.st
share/enscript/hl/outline.st
@ -122,6 +121,7 @@ share/enscript/hl/pascal.st
share/enscript/hl/passthrough.st
share/enscript/hl/perl.st
share/enscript/hl/postscript.st
share/enscript/hl/pyrex.st
share/enscript/hl/python.st
share/enscript/hl/rfc.st
share/enscript/hl/scheme.st
@ -155,5 +155,20 @@ share/enscript/simple.hdr
share/enscript/squeeze.hdr
share/enscript/vms.enc
share/examples/enscript/
share/examples/enscript/enscript.cfg-sample
share/examples/enscript/enscript.cfg
@sample ${SYSCONFDIR}/enscript.cfg
share/locale/ca/LC_MESSAGES/enscript.mo
share/locale/da/LC_MESSAGES/enscript.mo
share/locale/de/LC_MESSAGES/enscript.mo
share/locale/en_GB/
share/locale/en_GB/LC_MESSAGES/
share/locale/en_GB/LC_MESSAGES/enscript.mo
share/locale/es/LC_MESSAGES/enscript.mo
share/locale/fr/LC_MESSAGES/enscript.mo
share/locale/hr/LC_MESSAGES/enscript.mo
share/locale/nl/LC_MESSAGES/enscript.mo
share/locale/pt_BR/LC_MESSAGES/enscript.mo
share/locale/ru/LC_MESSAGES/enscript.mo
share/locale/sl/LC_MESSAGES/enscript.mo
share/locale/sv/LC_MESSAGES/enscript.mo
share/locale/tr/LC_MESSAGES/enscript.mo