[packages/xfig] - up to 3.2.5c

arekm arekm at pld-linux.org
Thu Oct 31 18:29:00 CET 2013


commit dfcb6ad8c5d5fe66ee73560db99743915a8b2c05
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 31 18:28:58 2013 +0100

    - up to 3.2.5c

 38_formatstring.patch             | 14 ++++++++
 xfig-3.2.5b-CVE-2010-4262.patch   | 22 ------------
 xfig-3.2.5b-figparserstack.patch  | 61 ----------------------------------
 xfig-3.2.5b-fix-eps-reading.patch | 46 -------------------------
 xfig-3.2.5b-libpng-1.5.patch      | 70 ---------------------------------------
 xfig-3.2.5b-spelling.patch        | 29 ----------------
 xfig-config.patch                 | 43 +++---------------------
 xfig-i18n.patch                   | 13 +++++---
 xfig.spec                         | 24 ++++++--------
 9 files changed, 36 insertions(+), 286 deletions(-)
---
diff --git a/xfig.spec b/xfig.spec
index 7bb8370..d43fb56 100644
--- a/xfig.spec
+++ b/xfig.spec
@@ -8,31 +8,29 @@ Summary(ru.UTF-8):	Инструмент для рисования простой
 Summary(tr.UTF-8):	X11 çizim aracı
 Summary(uk.UTF-8):	Інструмент для малювання простої векторної графіки
 Name:		xfig
-Version:	3.2.5b
-Release:	2
+Version:	3.2.5c
+Release:	1
 License:	Freeware
 Group:		X11/Applications/Graphics
 #Source0Download: http://xfig.org/art15.html
 #Source0:	http://files.xfig.org/%{name}.%{version}.full.tar.gz
 Source0:	http://downloads.sourceforge.net/mcj/%{name}.%{version}.full.tar.gz
-# Source0-md5:	499b0ce103a6b353453bf7e327f9a3b9
+# Source0-md5:	210851330fa4bb3581bec1f8448a4db8
 Source1:	%{name}.desktop
 Source2:	%{name}.png
 Patch0:		%{name}-config.patch
 Patch1:		%{name}-i18n.patch
+Patch2:		38_formatstring.patch
 
 Patch5:		%{name}-3.2.5b-zoom-during-edit.patch
 Patch6:		%{name}-3.2.5b-urwfonts.patch
-Patch7:		%{name}-3.2.5b-spelling.patch
+
 Patch8:		%{name}-3.2.5b-pdfimport_mediabox.patch
 Patch9:		%{name}-3.2.5b-papersize_b1.patch
 Patch10:	%{name}-3.2.5b-network_images.patch
 Patch11:	%{name}-3.2.5b-mkstemp.patch
-Patch12:	%{name}-3.2.5b-figparserstack.patch
+
 Patch13:	%{name}-3.2.5b-app-defaults.patch
-Patch14:	%{name}-3.2.5b-CVE-2010-4262.patch
-Patch15:	%{name}-3.2.5b-libpng-1.5.patch
-Patch16:	%{name}-3.2.5b-fix-eps-reading.patch
 URL:		http://www.xfig.org/
 BuildRequires:	Xaw3d-devel
 BuildRequires:	libjpeg-devel
@@ -101,19 +99,17 @@ Xfig - це інструмент для створення базової век
 %setup -q -n %{name}.%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %patch5 -p2
 %patch6 -p0
-%patch7 -p1
+
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
 %patch11 -p0
-%patch12 -p1
+
 %patch13 -p0
-%patch14 -p0
-%patch15 -p1
-%patch16 -p1
 
 %build
 xmkmf -a
@@ -153,7 +149,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc Doc/html/ Doc/*.html README CHANGES FIGAPPS Doc/TODO Doc/FORMAT*
+%doc Doc/html/ README CHANGES FIGAPPS Doc/TODO Doc/FORMAT*
 %attr(755,root,root) %{_bindir}/xfig
 # top dir belongs to transfig, which is required by xfig
 %{_datadir}/xfig/CompKeyDB
diff --git a/38_formatstring.patch b/38_formatstring.patch
new file mode 100644
index 0000000..985caa3
--- /dev/null
+++ b/38_formatstring.patch
@@ -0,0 +1,14 @@
+From: Roland Rosenfeld <roland at debian.org>
+Subject: Fix format string error with hardening.
+
+--- a/w_msgpanel.c
++++ b/w_msgpanel.c
+@@ -588,7 +588,7 @@
+ 
+     strcat(tmpstr,"\n");
+     if (update_figs) {
+-	fprintf(stderr,tmpstr);
++       fprintf(stderr, "%s", tmpstr);
+     } else {
+ 	/* append this message to the file message widget string */
+ 	block.firstPos = 0;
diff --git a/xfig-3.2.5b-CVE-2010-4262.patch b/xfig-3.2.5b-CVE-2010-4262.patch
deleted file mode 100644
index eb85513..0000000
--- a/xfig-3.2.5b-CVE-2010-4262.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- w_msgpanel.c 	
-+++ w_msgpanel.c 2010-12-03 14:21:07.931926127 +0000
-@@ -60,7 +60,7 @@ DeclareStaticArgs(12);
- /* for the popup message (file_msg) window */
- 
- static int	file_msg_length=0;
--static char	tmpstr[300];
-+static char	tmpstr[512];
- static Widget	file_msg_panel,
- 		file_msg_win, file_msg_dismiss;
- 
-@@ -582,8 +582,8 @@ file_msg(char *format,...)
-     }
- 
-     va_start(ap, format);
--    /* format the string */
--    vsprintf(tmpstr, format, ap);
-+    /* format the string (but leave room for \n and \0) */
-+    vsnprintf(tmpstr, sizeof(tmpstr)-2, format, ap);
-     va_end(ap);
- 
-     strcat(tmpstr,"\n");
diff --git a/xfig-3.2.5b-figparserstack.patch b/xfig-3.2.5b-figparserstack.patch
deleted file mode 100644
index 7f46682..0000000
--- a/xfig-3.2.5b-figparserstack.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 30_figparserstack.dpatch by Hans de Goede <j.w.r.degoede at hhs.nl>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix Stack-based buffer overflow by loading malformed .FIG files
-## DP: https://bugzilla.redhat.com/show_bug.cgi?id=543905
-## DP: Closes: #559274
-
- at DPATCH@
-diff -urNad xfig~/f_readold.c xfig/f_readold.c
---- xfig~/f_readold.c
-+++ xfig/f_readold.c
-@@ -471,7 +471,7 @@
-     F_text	   *t;
-     int		    n;
-     int		    dum;
--    char	    buf[128];
-+    char	    buf[512];
-     PR_SIZE	    tx_dim;
- 
-     if ((t = create_text()) == NULL)
-@@ -485,22 +485,34 @@
-     t->pen_style = -1;
-     t->angle = 0.0;
-     t->next = NULL;
-+    if (!fgets(buf, sizeof(buf), fp)) {
-+	file_msg("Incomplete text data");
-+	free((char *) t);
-+	return (NULL);
-+    }
-+
-+    /* Note using strlen(buf) here will waste a few bytes, as the
-+       various text attributes are counted into this length too. */
-+    if ((t->cstring = new_string(strlen(buf))) == NULL)
-+        return (NULL);
-+
-     /* ascent and length will be recalculated later */
--    n = fscanf(fp, " %d %d %d %d %d %d %d %[^\n]",
-+    n = sscanf(buf, " %d %d %d %d %d %d %d %[^\n]",
- 		&t->font, &dum, &dum, &t->ascent, &t->length,
--		&t->base_x, &t->base_y, buf);
-+		&t->base_x, &t->base_y, t->cstring);
-     if (n != 8) {
- 	file_msg("Incomplete text data");
-+	free(t->cstring);
- 	free((char *) t);
- 	return (NULL);
-     }
--    if ((t->cstring = new_string(strlen(buf))) == NULL) {
-+
-+    if (!strlen(t->cstring)) {
-+	free(t->cstring);
- 	free((char *) t);
- 	file_msg("Empty text string at line %d.", line_no);
- 	return (NULL);
-     }
--    /* put string in structure */
--    strcpy(t->cstring, buf);
- 
-     /* get the font struct */
-     t->zoom = zoomscale;
diff --git a/xfig-3.2.5b-fix-eps-reading.patch b/xfig-3.2.5b-fix-eps-reading.patch
deleted file mode 100644
index 7601d20..0000000
--- a/xfig-3.2.5b-fix-eps-reading.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -ur xfig.3.2.5b/f_readeps.c xfig.3.2.5b.new/f_readeps.c
---- xfig.3.2.5b/f_readeps.c	2009-03-30 17:52:18.000000000 +0200
-+++ xfig.3.2.5b.new/f_readeps.c	2010-11-25 16:53:54.328247928 +0100
-@@ -252,12 +252,13 @@
- {
-     char        buf[300];
-     FILE       *tmpfp, *pixfile, *gsfile;
--    char       *psnam, *driver;
-+    char       *driver;
-     int         status, wid, ht, nbitmap, fd;
-     char        tmpfile[PATH_MAX],
- 		pixnam[PATH_MAX],
- 		errnam[PATH_MAX],
--		gscom[2 * PATH_MAX];
-+		gscom[2 * PATH_MAX],
-+		psnam[PATH_MAX];
- 
-     wid = urx - llx;
-     ht = ury - lly;
-@@ -307,19 +308,14 @@
- 	/* for color, use pcx */
- 	driver = "pcx256";
-     }
--    /* avoid absolute paths (for Cygwin with gswin32) by changing directory */
--    if (tmpfile[0] == '/') {
--	psnam = strrchr(tmpfile, '/');
--	*psnam = 0;
--	sprintf(gscom, "cd \"%s/\";", tmpfile);
--	*psnam++ = '/';		/* Restore name for unlink() below */
--    } else {
--	psnam = tmpfile;
--	gscom[0] = '\0';
-+    /* Canonicalize the eps file filename, needed to "defeat" -dSAFER */
-+    if (!realpath(tmpfile, psnam)) {
-+	file_msg("Cannot canonicalize %s: %s\n", tmpfile, strerror(errno));
-+	return False;
-     }
--    sprintf(&gscom[strlen(gscom)],
--	    "%s -r72x72 -dSAFER -sDEVICE=%s -g%dx%d -sOutputFile=%s -q - > %s 2>&1",
--	    appres.ghostscript, driver, wid, ht, pixnam, errnam);
-+    sprintf(gscom,
-+	    "%s -r72x72 -sDEVICE=%s -g%dx%d -sOutputFile=%s -dDELAYSAFER -c '<< /PermitFileReading [ (%s)] >> setuserparams .locksafe' -dSAFER -q - > %s 2>&1",
-+	    appres.ghostscript, driver, wid, ht, pixnam, psnam, errnam);
-     if (appres.DEBUG)
- 	fprintf(stderr,"calling: %s\n",gscom);
-     if ((gsfile = popen(gscom, "w")) == 0) {
diff --git a/xfig-3.2.5b-libpng-1.5.patch b/xfig-3.2.5b-libpng-1.5.patch
deleted file mode 100644
index 7d9c3f1..0000000
--- a/xfig-3.2.5b-libpng-1.5.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-Index: xfig.3.2.5b/f_readpng.c
-===================================================================
---- xfig.3.2.5b.orig/f_readpng.c
-+++ xfig.3.2.5b/f_readpng.c
-@@ -73,7 +73,7 @@ read_png(FILE *file, int filetype, F_pic
-     }
- 
-     /* set long jump recovery here */
--    if (setjmp(png_ptr->jmpbuf)) {
-+    if (setjmp(png_jmpbuf(png_ptr))) {
- 	/* if we get here there was a problem reading the file */
- 	png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
- 	close_picfile(file,filetype);
-@@ -90,15 +90,17 @@ read_png(FILE *file, int filetype, F_pic
-     png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth, &color_type,
- 	&interlace_type, &compression_type, &filter_type);
- 
--    if (info_ptr->valid & PNG_INFO_gAMA)
--	png_set_gamma(png_ptr, 2.2, info_ptr->gamma);
--    else
--	png_set_gamma(png_ptr, 2.2, 0.45);
-+    png_fixed_point gamma = 0.45;
-+    png_get_gAMA_fixed(png_ptr,info_ptr,&gamma);
-+    png_set_gamma(png_ptr, 2.2, gamma);
- 
--    if (info_ptr->valid & PNG_INFO_bKGD)
-+    if (png_get_valid(png_ptr,info_ptr,PNG_INFO_bKGD)) {
- 	/* set the background to the one supplied */
--	png_set_background(png_ptr, &info_ptr->background,
-+	png_color_16p background;
-+	png_get_bKGD(png_ptr,info_ptr,&background);
-+	png_set_background(png_ptr, background,
- 		PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
-+    }
-     else {
- 	/* blend the canvas background using the alpha channel */
- 	background.red   = x_bg_color.red >> 8;
-@@ -136,7 +138,11 @@ read_png(FILE *file, int filetype, F_pic
- 
- 	if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)) {
- 	    png_get_hIST(png_ptr, info_ptr, &histogram);
-+#if PNG_LIBPNG_VER_MAJOR <= 1 && PNG_LIBPNG_VER_MINOR < 5
- 	    png_set_dither(png_ptr, palette, num_palette, 256, histogram, 0);
-+#else
-+	    png_set_quantize(png_ptr, palette, num_palette, 256, histogram, 0);
-+#endif
- 	}
-     }
-     if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
-Index: xfig.3.2.5b/f_wrpng.c
-===================================================================
---- xfig.3.2.5b.orig/f_wrpng.c
-+++ xfig.3.2.5b/f_wrpng.c
-@@ -20,6 +20,7 @@
- #include "w_msgpanel.h"
- #include "w_setup.h"
- #include <png.h>
-+#include <zlib.h>
- 
- /*
-  * Write PNG file from rgb data
-@@ -59,7 +60,7 @@ write_png(FILE *file, unsigned char *dat
-     }
- 
-     /* set long jump recovery here */
--    if (setjmp(png_ptr->jmpbuf)) {
-+    if (setjmp(png_jmpbuf(png_ptr))) {
- 	/* if we get here there was a problem reading the file */
- 	png_destroy_write_struct(&png_ptr, &info_ptr);
- 	return False;
diff --git a/xfig-3.2.5b-spelling.patch b/xfig-3.2.5b-spelling.patch
deleted file mode 100644
index 942276c..0000000
--- a/xfig-3.2.5b-spelling.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 31_spelling.dpatch by Roland Rosenfeld <roland at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix spelling errors in binary.
-
- at DPATCH@
-diff -urNad xfig~/f_load.c xfig/f_load.c
---- xfig~/f_load.c
-+++ xfig/f_load.c
-@@ -373,5 +373,5 @@
- 	/* Format error; relevant error message is already delivered */
- 	;
-     else
--	file_msg("File \"%s\" is not accessable; %s.", file, strerror(err));
-+	file_msg("File \"%s\" is not accessible; %s.", file, strerror(err));
- }
-diff -urNad xfig~/f_readgif.c xfig/f_readgif.c
---- xfig~/f_readgif.c
-+++ xfig/f_readgif.c
-@@ -137,7 +137,7 @@
- 
- 		if (c == '!') { 		/* Extension */
- 			if (! ReadOK(file,&c,1))
--				file_msg("GIF read error on extention function code");
-+				file_msg("GIF read error on extension function code");
- 			(void) DoGIFextension(file, c);
- 			continue;
- 		}
diff --git a/xfig-config.patch b/xfig-config.patch
index 6d0679c..3d742ab 100644
--- a/xfig-config.patch
+++ b/xfig-config.patch
@@ -1,48 +1,13 @@
 diff -urN xfig.3.2.5.org/Imakefile xfig.3.2.5/Imakefile
 --- xfig.3.2.5.org/Imakefile	2006-10-11 01:19:22.000000000 +0200
 +++ xfig.3.2.5/Imakefile	2009-01-22 17:50:16.832801134 +0100
-@@ -60,7 +60,7 @@
- XCOMM some new features, including "Tips", which replace xfig's "help balloons"
- XCOMM NOTE: This is the default for many X systems now.
- 
--XCOMM #define XAW3D1_5E
-+#define XAW3D1_5E
- 
- #ifdef XAW3D1_5E
-     DUSEXAW3D = -DXAW3D -DXAW3D1_5E
-@@ -73,7 +73,7 @@
+@@ -76,7 +76,7 @@
  XCOMM are in different places
  
  PNGLIBDIR = $(USRLIBDIR)
--PNGINC = -I/usr/local/include
-+PNGINC = 
+-PNGINC = -I/usr/include
++PNGINC =
  ZLIBDIR = $(USRLIBDIR)
  
  XCOMM If don't want JPEG support, comment out the #define USEJPEG line
-@@ -117,7 +117,7 @@
- 
- #ifdef USEXPM
- XPMLIBDIR = /usr/local/lib
--XPMINC = -I/usr/local/include/X11
-+XPMINC = -I/usr/include/X11
- #endif
- 
- XCOMM Uncomment the following definiton if you want to use the small icons
-@@ -158,7 +158,7 @@
- XCOMM inline functions. With the "INLINE" keyword, you should notice that
- XCOMM the display will be a bit faster in complex figures
- 
--XCOMM USEINLINE = -DUSE_INLINE
-+USEINLINE = -DUSE_INLINE
- 
- XCOMM use (and change) the following if you want the multi-key data base file
- XCOMM somewhere other than the standard X11 library directory
-@@ -241,7 +241,7 @@
- #endif /* USEJPEG */
- 
- #ifdef I18N
--I18N_DEFS = -DI18N -DSETLOCALE
-+I18N_DEFS = -DI18N
- I18N_SRC = w_i18n.c
- I18N_OBJ = w_i18n.o
- #endif
+
diff --git a/xfig-i18n.patch b/xfig-i18n.patch
index 77a92f9..7a75aa3 100644
--- a/xfig-i18n.patch
+++ b/xfig-i18n.patch
@@ -1,12 +1,15 @@
-diff -urN xfig.3.2.3d.org/Fig.ad xfig.3.2.3d/Fig.ad
---- xfig.3.2.3d.org/Fig.ad	Thu Oct 25 23:14:36 2001
-+++ xfig.3.2.3d/Fig.ad	Thu Oct 25 23:15:04 2001
-@@ -158,7 +158,7 @@
+--- xfig.3.2.5c/Fig.ad~	2012-02-16 21:21:34.000000000 +0100
++++ xfig.3.2.5c/Fig.ad	2013-10-31 18:22:21.589616162 +0100
+@@ -178,9 +178,9 @@
  
- ! If xfig is compiled with I18N option, you may want to uncomment following line.
+ ! If xfig is compiled with I18N option, you may want to uncomment following lines.
  !
 -!Fig.international: true
+-!Fig.localeEncoding: true
+-!Fig.alwaysUseFontSet: true
 +Fig.international: true
++Fig.localeEncoding: true
++Fig.alwaysUseFontSet: true
  
  ! Note that you shouldn't remove the following "Fig*international: false".  
  ! It must be there to cancel any *international: true that may defined via xrdb.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xfig.git/commitdiff/dfcb6ad8c5d5fe66ee73560db99743915a8b2c05



More information about the pld-cvs-commit mailing list