[54115] trunk/dports/print/enscript

kimuraw at macports.org kimuraw at macports.org
Tue Jul 21 09:11:33 PDT 2009


Revision: 54115
          http://trac.macports.org/changeset/54115
Author:   kimuraw at macports.org
Date:     2009-07-21 09:11:32 -0700 (Tue, 21 Jul 2009)
Log Message:
-----------
print/enscript: 1.6.4_3
	- homepage was moved
	- support ruby syntax
	- import a security patch from freebsd

Modified Paths:
--------------
    trunk/dports/print/enscript/Portfile

Added Paths:
-----------
    trunk/dports/print/enscript/files/patch-CVE-2008-3863-and-4306
    trunk/dports/print/enscript/files/patch-ruby_syntax.diff

Modified: trunk/dports/print/enscript/Portfile
===================================================================
--- trunk/dports/print/enscript/Portfile	2009-07-21 15:35:45 UTC (rev 54114)
+++ trunk/dports/print/enscript/Portfile	2009-07-21 16:11:32 UTC (rev 54115)
@@ -3,7 +3,7 @@
 PortSystem			1.0
 name				enscript
 version				1.6.4
-revision			2
+revision			3
 categories			print
 maintainers			nomaintainer
 description			Replacement for Adobe's 'enscript' program
@@ -14,7 +14,7 @@
 
 platforms			darwin sunos
 
-homepage			http://people.ssh.fi/mtr/genscript/
+homepage			http://www.codento.com/people/mtr/genscript/
 #master_sites		${homepage}
 master_sites		freebsd
 
@@ -24,8 +24,13 @@
 patchfiles			patch-afm_Makefile.in patch-lib_Makefile.in \
 					patch-src_gsint.h patch-src_main.c patch-src_psgen.c \
 					patch-src_util.c patch-states_hl_Makefile.in \
-					patch-configure
+					patch-configure patch-CVE-2008-3863-and-4306
 
+# add ruby syntax support from
+# http://www.freebsd.org/cgi/cvsweb.cgi/ports/print/enscript-letter/
+# and from http://support.rubyforge.org/svn/trunk/support/ruby.st
+patchfiles-append	patch-ruby_syntax.diff
+
 configure.args		--mandir=${prefix}/share/man --with-media=Letter \
 					--infodir=${prefix}/share/info
 
@@ -37,7 +42,7 @@
 test.run			yes
 test.target			check
 
-variant mediaA4 {
+variant mediaA4 description "use A4" {
 	configure.args-delete	--with-media=Letter
 	configure.args-append	--with-media=A4
 }

Added: trunk/dports/print/enscript/files/patch-CVE-2008-3863-and-4306
===================================================================
--- trunk/dports/print/enscript/files/patch-CVE-2008-3863-and-4306	                        (rev 0)
+++ trunk/dports/print/enscript/files/patch-CVE-2008-3863-and-4306	2009-07-21 16:11:32 UTC (rev 54115)
@@ -0,0 +1,94 @@
+Patch for CVE-2008-3863 and CVE-2008-4306
+
+Obtained from: http://cvs.fedoraproject.org/viewvc/devel/enscript/enscript-CVE-2008-3863%2BCVE-2008-4306.patch?revision=1.1
+
+--- src/psgen.c
++++ src/psgen.c	2008-10-29 10:43:08.512598143 +0100
+@@ -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, To
+ 	  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, To
+       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, To
+ 		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, To
+ 	  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;

Added: trunk/dports/print/enscript/files/patch-ruby_syntax.diff
===================================================================
--- trunk/dports/print/enscript/files/patch-ruby_syntax.diff	                        (rev 0)
+++ trunk/dports/print/enscript/files/patch-ruby_syntax.diff	2009-07-21 16:11:32 UTC (rev 54115)
@@ -0,0 +1,253 @@
+diff -uNr ../enscript-1.6.4.mp_patched/states/hl/Makefile.in ./states/hl/Makefile.in
+--- ../enscript-1.6.4.mp_patched/states/hl/Makefile.in	2009-07-22 00:44:57.000000000 +0900
++++ ./states/hl/Makefile.in	2009-07-22 00:46:44.000000000 +0900
+@@ -188,9 +188,9 @@
+ diffs.st diffu.st elisp.st fortran.st fortran_pp.st haskell.st html.st	\
+ idl.st inf.st java.st javascript.st ksh.st m4.st mail.st makefile.st	\
+ matlab.st nroff.st objc.st outline.st pascal.st passthrough.st perl.st	\
+-postscript.st python.st pyrex.st rfc.st scheme.st sh.st skill.st	\
+-sql.st states.st synopsys.st tcl.st tcsh.st tex.st vba.st verilog.st	\
+-vhdl.st vrml.st wmlscript.st zsh.st
++postscript.st python.st pyrex.st ruby.st rfc.st scheme.st sh.st 	\
++skill.st sql.st states.st synopsys.st tcl.st tcsh.st tex.st vba.st 	\
++verilog.st vhdl.st vrml.st wmlscript.st zsh.st
+ 
+ 
+ states = $(misc) $(styles) $(languages) $(highlightings)
+diff -uNr ../enscript-1.6.4.mp_patched/states/hl/enscript.st ./states/hl/enscript.st
+--- ../enscript-1.6.4.mp_patched/states/hl/enscript.st	2003-03-05 17:31:31.000000000 +0900
++++ ./states/hl/enscript.st	2009-07-22 00:54:38.000000000 +0900
+@@ -489,6 +489,7 @@
+   /\.idl$/					idl;
+   /\.(hs|lhs|gs|lgs)$/				haskell;
+   /\.(pm|pl)$/					perl;
++  /\.(rb|rbw)$/					ruby;
+   /\.(eps|EPS|ps|PS)$/				postscript;
+   /\.py$/					python;
+   /\.pyx$/					pyrex;
+@@ -530,6 +531,8 @@
+   /-\*- [Ii][Dd][Ll] -\*-/				idl;
+   /-\*- [Pp][Ee][Rr][Ll] -\*-/				perl;
+   /^#![ \t]*\/.*\/perl/					perl;
++  /-\*- [Rr][Uu][Bb][Yy] -\*-/				ruby;
++  /^#![ \t]*\/.*\/(env )?ruby/				ruby;
+   /^From:/						mail;
+   /^#![ \t]*(\/usr)?\/bin\/[ngmt]?awk/			awk;
+   /^#![ \t]*(\/usr)?\/bin\/sh/				sh;
+diff -uNr ../enscript-1.6.4.mp_patched/states/hl/ruby.st ./states/hl/ruby.st
+--- ../enscript-1.6.4.mp_patched/states/hl/ruby.st	1970-01-01 09:00:00.000000000 +0900
++++ ./states/hl/ruby.st	2009-07-22 00:45:47.000000000 +0900
+@@ -0,0 +1,213 @@
++/**
++ * Name: ruby
++ * Description: Ruby programming language.
++ * Author: Mike Wilson
++ */
++
++state ruby_comment
++{
++  /\*\\\// {
++    language_print ($0);
++    return;
++  }
++  LANGUAGE_SPECIALS {
++   language_print ($0);
++  }
++}
++
++state ruby_dquot_string
++{
++  /\\\\./ {
++    language_print ($0);
++  }
++  /\"/ {
++    language_print ($0);
++    return;
++  }
++  LANGUAGE_SPECIALS {
++    language_print ($0);
++  }
++}
++
++state ruby_quot_string
++{
++  /\\\\./ {
++    language_print ($0);
++  }
++  /[\']/ {
++    language_print ($0);
++    return;
++  }
++  LANGUAGE_SPECIALS {
++    language_print ($0);
++  }
++}
++
++state ruby_bquot_string
++{
++  /\\\\./ {
++    language_print ($0);
++  }
++  /`/ {
++    language_print ($0);
++    return;
++  }
++  LANGUAGE_SPECIALS {
++    language_print ($0);
++  }
++}
++
++state ruby
++{
++  BEGIN {
++    header ();
++  }
++  END {
++    trailer ();
++  }
++
++  /* Comments. */
++  /#[^{].*$/ {
++    comment_face (true);
++    language_print ($0);
++    comment_face (false);
++  }
++
++  /* Ignore escaped quote marks */
++  /\\\"/ {
++    language_print ($0);
++  }
++  /\\\'/ {
++    language_print ($0);
++  }
++  /\\\`/ {
++    language_print ($0);
++  }
++
++  /* In cgi files, JavaScript might be imbedded, so we need to look out
++   * for the JavaScript comments, because they might contain something
++   * we don't like, like a contraction (don't, won't, etc.)
++   * We won't put them in comment face, because they are not ruby
++   * comments.
++   */
++  /\/\// {
++    language_print ($0);
++    call (eat_one_line);
++  }
++
++  /* String constants. */
++  /\"/ {
++    string_face (true);
++    language_print ($0);
++    call (ruby_dquot_string);
++    string_face (false);
++  }
++  /[\']/ {
++    string_face (true);
++    language_print ($0);
++    call (ruby_quot_string);
++    string_face (false);
++  }
++
++  /* Backquoted command string */
++  /`/ {
++    string_face (true);
++    language_print ($0);
++    call (ruby_bquot_string);
++    string_face (false);
++  }
++
++  /* Variables globals and instance */
++  /[$@]\w+/ {
++    variable_name_face (true);
++    language_print ($0);
++    variable_name_face (false);
++  }
++
++  /* Variables class variable */
++  /@@\w+/ {
++    variable_name_face (true);
++    language_print ($0);
++    variable_name_face (false);
++  }
++
++   /([ \t]*)(def)([ \t]+)([^(]*)/ {
++    /* indentation */
++    language_print ($1);
++
++    /* def */
++    keyword_face (true);
++    language_print ($2);
++    keyword_face (false);
++
++    /* middle */
++    language_print ($3);
++
++    /* Function name. */
++    function_name_face (true);
++    language_print ($4);
++    function_name_face (false);
++  }
++
++  /\$[!@&`'+~=\/\\,;.<>_*$?:"]/ {
++    variable_name_face (true);
++    language_print ($0);
++    variable_name_face (false);
++  }
++
++  /* Highlighting
++	--Type face
++ 	private protected public
++
++	--Reference face
++	require include load
++
++	--Builtin face (I consider these to be somewhat special)
++	alias alias_method attr attr_accessor attr_reader attr_writer 
++	module_alias module_function self super
++
++	--Keyword face
++	and begin break case class def defined? do else elsif end 
++	ensure eval extend false for if in method module next nil not 
++	or redo rescue retry return then true undef unless until when
++	while yield proc lambda loop catch throw __LINE__ __FILE__ END BEGIN
++   */
++/\\b(private|protected|public)\\b/ {
++    type_face (true);
++    language_print ($0);
++    type_face (false);
++  }
++
++/\\b(include|require|load)\\b/ {
++    reference_face (true);
++    language_print ($0);
++    reference_face (false);
++  }
++
++/\\b(alias|alias_method|attr|attr_accessor|attr_reader|attr_writer\\
++|module_alias|module_function|self|super)\\b/ {
++    builtin_face (true);
++    language_print ($0);
++    builtin_face (false);
++  }
++
++/\\b(and|begin|break|case|class|def|defined?|do|else|elsif|end|ensure|eval\\
++|extend|false|for|if|in|method|module|next|nil|not|or|raise|redo|rescue|retry\\
++|return|then|true|undef|unless|until|when|while|yield|proc|lambda|loop|catch\\
++|throw|__LINE__|__FILE__|END|BEGIN)\\b/ {
++    keyword_face (true);
++    language_print ($0);
++    keyword_face (false);
++  }
++
++  LANGUAGE_SPECIALS {
++    language_print ($0);
++  }
++}
++
++
++/*
++Local variables:
++mode: c
++End:
++*/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090721/39274d38/attachment.html>


More information about the macports-changes mailing list