From e0c463ef3770cad7c6e6437014372bd77973746e1eefe2e34714da0879d8a48b Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 17 Jun 2011 13:11:06 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/graphics/xfig?expand=0&rev=19 --- xfig.3.2.5b-preview.dif | 20 +++++++++++++------- xfig.changes | 5 +++++ xfig.spec | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/xfig.3.2.5b-preview.dif b/xfig.3.2.5b-preview.dif index 9f91efb..fedfc4d 100644 --- a/xfig.3.2.5b-preview.dif +++ b/xfig.3.2.5b-preview.dif @@ -1,12 +1,13 @@ --- f_readeps.c -+++ f_readeps.c 2010-12-01 14:26:05.884195851 +0000 ++++ f_readeps.c 2011-06-17 12:46:08.519926308 +0000 @@ -252,11 +252,12 @@ bitmap_from_gs(file, filetype, pic, urx, { char buf[300]; FILE *tmpfp, *pixfile, *gsfile; - char *psnam, *driver; +- int status, wid, ht, nbitmap, fd; + char *driver; - int status, wid, ht, nbitmap, fd; ++ int status, wid, ht, nbitmap, fd, len; char tmpfile[PATH_MAX], pixnam[PATH_MAX], errnam[PATH_MAX], @@ -14,7 +15,7 @@ gscom[2 * PATH_MAX]; wid = urx - llx; -@@ -307,19 +308,22 @@ bitmap_from_gs(file, filetype, pic, urx, +@@ -307,19 +308,26 @@ bitmap_from_gs(file, filetype, pic, urx, /* for color, use pcx */ driver = "pcx256"; } @@ -31,7 +32,7 @@ + if (!realpath(tmpfile, psnam)) { + file_msg("Cannot canonicalize %s: %s\n", tmpfile, strerror(errno)); + return False; - } ++ } + /* From Language.htm of ghostscript 9.00 and higher: + * If Ghostscript is started with -dNOSAFER or -dDELAYSAFER, this operator can + * be used to enter SAFER mode with the current set of PermitFile... user @@ -40,11 +41,16 @@ + * for file Reading, Writing and/or Control can use this operator to perform + * the locking needed to enter SAFER mode. + */ - 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); ++ len = snprintf(gscom, sizeof(gscom) - 1, + "%s -r72x72 -sDEVICE=%s -g%dx%d -dDELAYSAFER -sOutputFile=%s -c '<> setuserparams .locksafe' -q - > %s 2>&1", + appres.ghostscript, driver, wid, ht, pixnam, psnam, errnam); ++ if (len >= sizeof(gscom) - 1 || len < 0) { ++ file_msg("Cannot write to buffer, file name to large: %s\n", psnam); ++ 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); if (appres.DEBUG) fprintf(stderr,"calling: %s\n",gscom); if ((gsfile = popen(gscom, "w")) == 0) { diff --git a/xfig.changes b/xfig.changes index 0c5a0f0..6fccea6 100644 --- a/xfig.changes +++ b/xfig.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 17 15:07:40 CEST 2011 - werner@suse.de + +- Fix broken append mode for eps/ps import (bnc#696368) + ------------------------------------------------------------------- Fri Dec 3 15:23:11 CET 2010 - werner@suse.de diff --git a/xfig.spec b/xfig.spec index ecfba99..451ea72 100644 --- a/xfig.spec +++ b/xfig.spec @@ -31,7 +31,7 @@ Provides: xfig.3.2.3d Requires: transfig netpbm ghostscript-fonts-std AutoReqProv: on Version: 3.2.5b -Release: 9 +Release: 10 Summary: Facility for Interactive Generation of Figures under the X Window System Url: http://www.xfig.org/ Source: xfig.%{version}.tar.bz2