SOURCES: ghostscript-gpl-missquotes.patch (NEW), ghostscript-gpl-s...

djurban djurban at pld-linux.org
Thu Sep 1 19:39:03 CEST 2005


Author: djurban                      Date: Thu Sep  1 17:39:03 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- from ghostscript.spec

---- Files affected:
SOURCES:
   ghostscript-gpl-missquotes.patch (NONE -> 1.1)  (NEW), ghostscript-gpl-setuid.patch (NONE -> 1.1)  (NEW), ghostscript-gpl-time_h.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ghostscript-gpl-missquotes.patch
diff -u /dev/null SOURCES/ghostscript-gpl-missquotes.patch:1.1
--- /dev/null	Thu Sep  1 19:39:03 2005
+++ SOURCES/ghostscript-gpl-missquotes.patch	Thu Sep  1 19:38:58 2005
@@ -0,0 +1,89 @@
+diff -urN espgs-7.07.1rc2.org/lib/dvipdf espgs-7.07.1rc2/lib/dvipdf
+--- espgs-7.07.1rc2.org/lib/dvipdf	Sun Sep 14 18:43:09 2003
++++ espgs-7.07.1rc2/lib/dvipdf	Sun Sep 14 18:43:26 2003
+@@ -22,7 +22,7 @@
+ 	exit 1
+ fi
+ 
+-infile=$1;
++infile="$1";
+ 
+ if [ $# -eq 1 ]
+ then
+@@ -32,7 +32,7 @@
+ 	esac
+ 	outfile="${base}".pdf
+ else
+-	outfile=$2
++	outfile="$2"
+ fi
+ 
+ # We have to include the options twice because -I only takes effect if it
+diff -urN espgs-7.07.1rc2.org/lib/pdf2dsc espgs-7.07.1rc2/lib/pdf2dsc
+--- espgs-7.07.1rc2.org/lib/pdf2dsc	Sun Sep 14 18:43:09 2003
++++ espgs-7.07.1rc2/lib/pdf2dsc	Sun Sep 14 18:43:26 2003
+@@ -20,7 +20,7 @@
+ 
+ pdffile=$1
+ dscfile=$2
+-: ${dscfile:=`echo $pdffile | sed 's,\.[^/.]*,,'`.dsc}
++: ${dscfile:=`echo "$pdffile" | sed 's,\.[^/.]*,,'`.dsc}
+ 
+ exec gs -q -dNODISPLAY -dSAFER -dDELAYSAFER\
+     -sPDFname="$pdffile" -sDSCname="$dscfile" pdf2dsc.ps -c quit
+diff -urN espgs-7.07.1rc2.org/lib/pdf2ps espgs-7.07.1rc2/lib/pdf2ps
+--- espgs-7.07.1rc2.org/lib/pdf2ps	Sun Sep 14 18:43:09 2003
++++ espgs-7.07.1rc2/lib/pdf2ps	Sun Sep 14 18:43:26 2003
+@@ -14,7 +14,7 @@
+ 
+ if [ $# -eq 2 ] 
+ then
+-    outfile=$2
++    outfile="$2"
+ elif [ $# -eq 1 ]
+ then
+     outfile=`basename "$1" \.pdf`.ps
+diff -urN espgs-7.07.1rc2.org/lib/pfbtopfa espgs-7.07.1rc2/lib/pfbtopfa
+--- espgs-7.07.1rc2.org/lib/pfbtopfa	Sun Sep 14 18:43:09 2003
++++ espgs-7.07.1rc2/lib/pfbtopfa	Sun Sep 14 18:43:26 2003
+@@ -4,7 +4,7 @@
+ 
+ if [ $# -eq 2 ] 
+ then
+-    outfile=$2
++    outfile="$2"
+ elif [ $# -eq 1 ]
+ then
+     outfile=`basename "$1" \.pfb`.pfa
+--- ghostscript-8.51/lib/ps2epsi.orig	2004-08-04 02:55:46.000000000 +0200
++++ ghostscript-8.51/lib/ps2epsi	2005-07-19 16:36:24.000000000 +0200
+@@ -5,7 +5,7 @@
+ # executable name set in the makefile
+ GS_EXECUTABLE=gs
+ 
+-tmpfile=/tmp/ps2epsi$$
++tmpfile=`mktemp /tmp/ps2epsi.XXXXXX` || exit 1
+ 
+ export outfile
+ 
+@@ -14,7 +14,7 @@
+ 	exit 1
+ fi
+ 
+-infile=$1;
++infile="$1";
+ 
+ if [ $# -eq 1 ]
+ then
+@@ -25,9 +25,9 @@
+ 	  *.epsf)	base=`basename "${infile}" .epsf` ;;
+ 	  *)		base=`basename "${infile}"` ;;
+ 	esac
+-	outfile=${base}.epsi
++	outfile="${base}.epsi"
+ else
+-	outfile=$2
++	outfile="$2"
+ fi
+ 
+ ls -l "${infile}" |

================================================================
Index: SOURCES/ghostscript-gpl-setuid.patch
diff -u /dev/null SOURCES/ghostscript-gpl-setuid.patch:1.1
--- /dev/null	Thu Sep  1 19:39:03 2005
+++ SOURCES/ghostscript-gpl-setuid.patch	Thu Sep  1 19:38:58 2005
@@ -0,0 +1,82 @@
+--- gs/src/imainarg.c.orig	Mon Dec  6 08:11:52 1999
++++ gs/src/imainarg.c	Thu Mar 30 23:01:34 2000
+@@ -48,6 +48,18 @@
+ #include "iutil.h"
+ #include "ivmspace.h"
+ 
++/* Change by Torsten Landschoff <torsten at debian.org>:
++ * We need to store the original rights when run with setuid so we can
++ * regain privileges when opening the vga library for instance.
++ *   -- Thu, 30 Mar 2000 22:47:22 +0200 */
++
++#include <unistd.h>
++
++uid_t privileged_uid;
++gid_t privileged_gid; 
++
++/* --- end change --- */
++
+ /* Import operator procedures */
+ extern int zflush(P1(i_ctx_t *));
+ extern int zflushpage(P1(i_ctx_t *));
+@@ -127,6 +139,20 @@
+     arg_list args;
+     FILE *stdfiles[3];
+     int code;
++
++    /* Change by Torsten Landschoff <torsten at debian.org>:
++     * We want to give up privileges as soon as possible when running suid.
++     * Right, you would not want to run a piece of software as complex as
++     * Ghostscript with setuid but you need to if you want to use the 
++     * svgalib as ordinary user. 
++     *  -- Thu, 30 Mar 2000 22:46:19 +0200 */
++
++    /* save privileges */
++    privileged_uid = geteuid();		privileged_gid = getegid();
++    /* give up privileges */
++    seteuid( getuid() );		setegid( getgid() );
++     
++    /* --- end change --- */
+ 
+     gs_get_real_stdio(stdfiles);
+     arg_init(&args, (const char **)argv, argc,
+--- gs/src/gdevl256.c.orig	Mon Jan 11 07:38:07 1999
++++ gs/src/gdevl256.c	Thu Mar 30 23:03:57 2000
+@@ -38,6 +38,17 @@
+ #include <vga.h>
+ #include <vgagl.h>
+ 
++/* Change by Torsten Landschoff <torsten at debian.org>:
++ * I changed imainarg.c to drop privileges as soon as possible when 
++ * running setuid. We need to get back elevated rights when we want 
++ * to open the vga library. Declare the two variables from imainarg.c
++ * holding the privileges and include unistd.h for user management.
++ *  -- Thu, 30 Mar 2000 22:59:53 +0200 */
++
++#include <unistd.h>
++extern uid_t privileged_uid;
++extern gid_t privileged_gid;
++
+ /* The color map for dynamically assignable colors. */
+ #define first_dc_index 64
+ private int next_dc_index;
+@@ -107,7 +118,19 @@
+     int vgamode;
+     int width, height;
+ 
++    /* Change by Torsten Landschoff <torsten at debian.org>:
++     * We need to restore the privileges we gave up in imainarg.c to open
++     * the vga device. 
++     * -- Thu, 30 Mar 2000 23:03:12 +0200 */
++
++    /* re-obtain privileges */
++    seteuid( privileged_uid );	setegid( privileged_gid );
+     vga_init();
++    /* give away privileges */
++    seteuid( getuid() );	setegid( getgid() );
++
++    /* --- end change --- */
++
+     vgamode = vga_getdefaultmode();
+     if (vgamode == -1)
+ 	vgamode = G320x200x256;

================================================================
Index: SOURCES/ghostscript-gpl-time_h.patch
diff -u /dev/null SOURCES/ghostscript-gpl-time_h.patch:1.1
--- /dev/null	Thu Sep  1 19:39:03 2005
+++ SOURCES/ghostscript-gpl-time_h.patch	Thu Sep  1 19:38:58 2005
@@ -0,0 +1,12 @@
+--- gs6.50/src/time_.h.wiget	Tue Feb 20 13:20:40 2001
++++ gs6.50/src/time_.h	Tue Feb 20 13:21:30 2001
+@@ -37,6 +37,9 @@
+  * The HAVE_SYS_TIME_H switch in gconfig_.h reflects this.
+  */
+ #ifdef HAVE_SYS_TIME_H
++#  ifdef __linux__
++#    include <time.h>
++#  endif
+ #  include <sys/time.h>
+ #  if defined(Plan9) || defined(M_UNIX) || defined(_IBMR2) || defined(_SEQUENT_)	/* Plan 9, SCO, AIX and Sequent's DYNIX/ptx need both time.h and sys/time.h! */
+ #    include <time.h>
================================================================



More information about the pld-cvs-commit mailing list