SOURCES: ghostscript-afpl-am.patch (NEW), ghostscript-afpl-ijs_pkg...

djurban djurban at pld-linux.org
Tue Sep 6 18:24:57 CEST 2005


Author: djurban                      Date: Tue Sep  6 16:24:57 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- from ghostscript.spec's HEAD
- lost the logs, but i dont have time to mail the commands for all those files to cvs admins

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

---- Diffs:

================================================================
Index: SOURCES/ghostscript-afpl-am.patch
diff -u /dev/null SOURCES/ghostscript-afpl-am.patch:1.1
--- /dev/null	Tue Sep  6 18:24:57 2005
+++ SOURCES/ghostscript-afpl-am.patch	Tue Sep  6 18:24:51 2005
@@ -0,0 +1,103 @@
+--- ghostscript-8.51/configure.ac.am	2005-01-25 02:19:34.000000000 +0100
++++ ghostscript-8.51/configure.ac	2005-07-19 22:12:23.000000000 +0200
+@@ -147,6 +147,32 @@
+ 	GCFLAGS="$GCFLAGS -DGX_COLOR_INDEX_TYPE=\"$uint64_type\""
+ fi
+ 
++dnl look for default font path...
++AC_ARG_WITH(fontpath, [  --with-fontpath         set font path for gs],fontpath="$withval",fontpath="")
++
++dnl Fix "prefix" variable...
++if test "x$prefix" = xNONE; then
++        prefix=/usr/local
++fi
++
++dnl Fix "datadir" variable...
++if test "x$datadir" = 'x${prefix}/share'; then
++        datadir="$prefix/share"
++fi
++	dnl Fix "fontpath" variable...
++if test "x$fontpath" = "x"; then
++# These font directories are used by various Linux distributions...
++     fontpath="$datadir/fonts/default/ghostscript"
++     fontpath="${fontpath}:$datadir/fonts/default/Type1"
++     fontpath="${fontpath}:$datadir/fonts/default/TrueType"
++     # These font directories are used by IRIX...
++     fontpath="${fontpath}:/usr/lib/DPS/outline/base"
++     # These font directories are used by Solaris...
++     fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/Type1"
++     fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/TrueType"
++fi
++
++AC_SUBST(fontpath)
+ 
+ dnl --------------------------------------------------
+ dnl Check for libraries
+@@ -306,55 +332,13 @@
+ SHARE_JASPER=0
+ JPXDEVS=''
+ if test x$with_jasper != xno; then
+-  AC_MSG_CHECKING([for local jasper library source])
+-  for d in jasper jasper-1.7*; do
+-    test -d "$d" && JASPERDIR=$d && break
+-  done
+-  if test "x$JASPERDIR" != xsrc; then
+-    AC_MSG_RESULT([$JASPERDIR])
+-    AC_MSG_CHECKING([for local jasper configure script])
+-    if test -x $JASPERDIR/configure; then
+-      AC_MSG_RESULT([yes])
+-      echo
+-      echo "Running jasper configure script..."
+-      olddir=`pwd`
+-      cd $JASPERDIR && ./configure
+-      cd $olddir
+-      echo
+-      echo "Continuing with Ghostscript configuration..."
+-    else
+-      AC_MSG_RESULT([no])
+-      AC_MSG_CHECKING([for local jasper autogen.sh script])
+-      if test -x $JASPERDIR/autogen.sh; then
+-        AC_MSG_RESULT([yes])
+-        echo
+-        echo "Running jasper autogen script..."
+-        olddir=`pwd`
+-        cd $JASPERDIR && ./autogen.sh
+-        cd $olddir
+-        echo
+-        echo "Continuing with Ghostscript configuration..."
+-      else
+-        AC_MSG_ERROR([
+-Unable to find $JASPERDIR/src/libjasper/include/jas_config.h,
+-or generate generate such a file for this system. You will
+-have to build one by hand, or configure, build and install
+-the jasper library separately.
+-
+-You can also pass --without-jasper to configure to disable
+-JPEG 2000 PDF image support entirely.
+-])
+-      fi
+-    fi
+-  else
+-    AC_MSG_RESULT([no])
++  JASPERDIR=
+     AC_CHECK_LIB([jasper], [jas_image_create], [
+ 	SHARE_JASPER=1
+     ], [
+ 	AC_MSG_WARN([disabling support for JPEG 2000 images])
+         with_jasper=no
+     ])
+-  fi
+ fi
+ if test x$with_jasper != xno; then
+   JPXDEVS='$(PSD)jpx.dev'
+--- ghostscript-8.51/src/Makefile.in~	2004-12-01 09:17:19.000000000 +0100
++++ ghostscript-8.51/src/Makefile.in	2005-07-21 13:46:26.000000000 +0200
+@@ -70,7 +70,7 @@
+ # Define the default directory/ies for the runtime
+ # initialization and font files.  Separate multiple directories with a :.
+ 
+-GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdatadir)/Resource:$(gsdir)/fonts
++GS_LIB_DEFAULT=$(gsdatadir)/lib:$(gsdatadir)/Resource:$(gsdir)/fonts:@fontpath@
+ 
+ # Define the default directory for cached data files
+ # this must be a single path.

================================================================
Index: SOURCES/ghostscript-afpl-ijs_pkgconfig_64.patch
diff -u /dev/null SOURCES/ghostscript-afpl-ijs_pkgconfig_64.patch:1.1
--- /dev/null	Tue Sep  6 18:24:57 2005
+++ SOURCES/ghostscript-afpl-ijs_pkgconfig_64.patch	Tue Sep  6 18:24:51 2005
@@ -0,0 +1,11 @@
+--- ghostscript-8.50/ijs/Makefile.am~	2004-02-10 22:31:41.000000000 +0000
++++ ghostscript-8.50/ijs/Makefile.am	2005-04-18 19:36:11.932219904 +0000
+@@ -34,7 +34,7 @@
+ 
+ pkgincludedir=$(includedir)/ijs
+ m4datadir = $(datadir)/aclocal
+-pkgconfigdatadir = $(prefix)/lib/pkgconfig
++pkgconfigdatadir = @libdir@/pkgconfig
+ 
+ lib_LTLIBRARIES = libijs.la
+ 

================================================================
Index: SOURCES/ghostscript-afpl-missquotes.patch
diff -u /dev/null SOURCES/ghostscript-afpl-missquotes.patch:1.1
--- /dev/null	Tue Sep  6 18:24:57 2005
+++ SOURCES/ghostscript-afpl-missquotes.patch	Tue Sep  6 18:24:51 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-afpl-setuid.patch
diff -u /dev/null SOURCES/ghostscript-afpl-setuid.patch:1.1
--- /dev/null	Tue Sep  6 18:24:57 2005
+++ SOURCES/ghostscript-afpl-setuid.patch	Tue Sep  6 18:24:51 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-afpl-time_h.patch
diff -u /dev/null SOURCES/ghostscript-afpl-time_h.patch:1.1
--- /dev/null	Tue Sep  6 18:24:57 2005
+++ SOURCES/ghostscript-afpl-time_h.patch	Tue Sep  6 18:24:51 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