summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ehmsen <ehmsen@gentoo.org>2006-05-08 17:36:45 +0000
committerMartin Ehmsen <ehmsen@gentoo.org>2006-05-08 17:36:45 +0000
commitd6e73dc7f1babfbc34e4949591c4a6484393a27d (patch)
tree2dc26bba61331f787c2e3766ff944bd81a4b1ed9
parentChanging myself to be the maintainer. (diff)
downloadgentoo-2-d6e73dc7f1babfbc34e4949591c4a6484393a27d.tar.gz
gentoo-2-d6e73dc7f1babfbc34e4949591c4a6484393a27d.tar.bz2
gentoo-2-d6e73dc7f1babfbc34e4949591c4a6484393a27d.zip
Added text-markup as herd. Fixed security bug #132662.
(Portage version: 2.1_pre10-r4)
-rw-r--r--app-text/pstotext/ChangeLog12
-rw-r--r--app-text/pstotext/files/digest-pstotext-1.9-r13
-rw-r--r--app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch117
-rw-r--r--app-text/pstotext/metadata.xml6
-rw-r--r--app-text/pstotext/pstotext-1.9-r1.ebuild36
5 files changed, 167 insertions, 7 deletions
diff --git a/app-text/pstotext/ChangeLog b/app-text/pstotext/ChangeLog
index a84d1975cb68..e1a42555f8ca 100644
--- a/app-text/pstotext/ChangeLog
+++ b/app-text/pstotext/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for app-text/pstotext
-# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/pstotext/ChangeLog,v 1.18 2005/10/08 21:12:10 vanquirius Exp $
+# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/pstotext/ChangeLog,v 1.19 2006/05/08 17:36:45 ehmsen Exp $
+
+*pstotext-1.9-r1 (08 May 2006)
+
+ 08 May 2006; Martin Ehmsen <ehmsen@gentoo.org>
+ +files/pstotext-1.9-quote-chars-fix.patch, metadata.xml,
+ -pstotext-1.9.ebuild, +pstotext-1.9-r1.ebuild:
+ Added text-markup as herd (taking over maintainership).
+ Fixed security bug #132662, by using Debian supplied patch.
*pstotext-1.9 (08 Oct 2005)
diff --git a/app-text/pstotext/files/digest-pstotext-1.9-r1 b/app-text/pstotext/files/digest-pstotext-1.9-r1
new file mode 100644
index 000000000000..f0cae0854c98
--- /dev/null
+++ b/app-text/pstotext/files/digest-pstotext-1.9-r1
@@ -0,0 +1,3 @@
+MD5 64576e8a10ff5514e285d98b3898ae78 pstotext-1.9.tar.gz 37461
+RMD160 16dc199d19df64280184d11ccbced7a32770ddad pstotext-1.9.tar.gz 37461
+SHA256 cfe0a251d0d43982a7d3bdf1d1670c854432739d00cb593c9beaca4b2cc36c27 pstotext-1.9.tar.gz 37461
diff --git a/app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch b/app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch
new file mode 100644
index 000000000000..d01c0e901bc4
--- /dev/null
+++ b/app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch
@@ -0,0 +1,117 @@
+diff -ru ../../pstotext-1.9/main.c ./main.c
+--- ../../pstotext-1.9/main.c 2005-07-24 18:56:11.000000000 +0200
++++ ./main.c 2006-03-21 21:55:55.000000000 +0100
+@@ -126,12 +126,14 @@
+ static int cleanup(void) {
+ int gsstatus, status = 0;
+ pstotextExit(instance);
+- if (gs!=NULL) {
+ #ifdef VMS
++ if (gs!=NULL) {
+ gsstatus = fclose(gs);
++ }
+ #else
+- gsstatus = pclose(gs);
++ waitpid(-1, &gsstatus, 0);
+ #endif
++ if (gsstatus) {
+ if (WIFEXITED(gsstatus)) {
+ if (WEXITSTATUS(gsstatus)!=0) status = 3;
+ else if (WIFSIGNALED(gsstatus)) status = 4;
+@@ -166,7 +168,13 @@
+
+ static int do_it(char *path) {
+ /* If "path" is NULL, then "stdin" should be processed. */
+- char *gs_cmdline;
++ char *gs_argv[32];
++ int gs_argc=0;
++#ifdef DEBUG
++ int i;
++#endif
++ int fd[2];
++ pid_t p;
+ char *input;
+ int status;
+ char norotate[] = "";
+@@ -216,32 +224,29 @@
+ cleanup();
+ exit(1);
+ }
+- strcpy(input, "-- '"); strcat(input, path); strcat(input, "'");
++ strcpy(input, path);
+ }
+
+- gs_cmdline = (char*)malloc(strlen(gs_cmd)+strlen(rotate_path)+
+- strlen(ocr_path) + strlen(input) + 128);
+-
+- if (gs_cmdline == NULL) {
+- fprintf(stderr, "No memory available\n");
+- cleanup();
+- exit(1);
+- }
+-
+- sprintf(
+- gs_cmdline,
+-#ifdef VMS
+- "%s -r72 \"-dNODISPLAY\" \"-dFIXEDMEDIA\" \"-dDELAYBIND\" \"-dWRITESYSTEMDICT\" %s \"-dNOPAUSE\" \"-dSAFER\" %s %s %s",
+-#else
+- "%s -r72 -dNODISPLAY -dFIXEDMEDIA -dDELAYBIND -dWRITESYSTEMDICT %s -dNOPAUSE -dSAFER %s %s %s",
+-#endif
+- gs_cmd,
+- (debug ? "" : "-q"),
+- rotate_path,
+- ocr_path,
+- input
+- );
+- if (debug) fprintf(stderr, "%s\n", gs_cmdline);
++ gs_argv[gs_argc++] = "gs";
++ gs_argv[gs_argc++] = "-r72";
++ gs_argv[gs_argc++] = "-dNODISPLAY";
++ gs_argv[gs_argc++] = "-dFIXEDMEDIA";
++ gs_argv[gs_argc++] = "-dDELAYBIND";
++ gs_argv[gs_argc++] = "-dWRITESYSTEMDICT";
++ if (!debug) {
++ gs_argv[gs_argc++] = "-q";
++ }
++ gs_argv[gs_argc++] = "-dNOPAUSE";
++ gs_argv[gs_argc++] = "-dSAFER";
++ if (rotate_path && strcmp(rotate_path, "")) {
++ gs_argv[gs_argc++] = rotate_path;
++ }
++ if (ocr_path && strcmp(ocr_path, "")) {
++ gs_argv[gs_argc++] = ocr_path;
++ }
++ gs_argv[gs_argc++] = "--";
++ gs_argv[gs_argc++] = input;
++ gs_argv[gs_argc++] = NULL;
+ #ifdef VMS
+ cmdfile = tempnam("SYS$SCRATCH:","PS2TGS");
+ gsoutfile = tempnam("SYS$SCRATCH:","GSRES");
+@@ -259,8 +264,25 @@
+ exit(1);
+ }
+ #else
+- gs = popen(gs_cmdline, "r");
+- if (gs==0) {perror(cmd); exit(1);}
++ if (pipe(fd)) {
++ perror("pipe failed: "); exit(1);
++ };
++ p = fork();
++ if (p == -1) {
++ perror("fork failed: "); exit(1);
++ }
++ if (p == 0) { /* child */
++ close(fd[0]);
++ dup2(fd[1], 1); /* Redirect stdout into pipe to parent */
++ execvp("/usr/bin/gs", gs_argv);
++ perror("execvp: "); status=cleanup(); exit(1);
++ } else { /* parent */
++ close(fd[1]);
++ gs = fdopen(fd[0], "r");
++ if (gs == NULL) {
++ perror("fdopen: "); status=cleanup(); exit(1);
++ }
++ }
+ #endif
+ status = pstotextInit(&instance);
+ if (status!=0) {
diff --git a/app-text/pstotext/metadata.xml b/app-text/pstotext/metadata.xml
index d8b96be3c5cd..3ef21588a731 100644
--- a/app-text/pstotext/metadata.xml
+++ b/app-text/pstotext/metadata.xml
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <herd>no-herd</herd>
- <maintainer>
- <email>bug-wranglers@gentoo.org</email>
- <description>This package lacks a primary herd or maintainer.</description>
- </maintainer>
+ <herd>text-markup</herd>
</pkgmetadata>
diff --git a/app-text/pstotext/pstotext-1.9-r1.ebuild b/app-text/pstotext/pstotext-1.9-r1.ebuild
new file mode 100644
index 000000000000..e3c8d001978d
--- /dev/null
+++ b/app-text/pstotext/pstotext-1.9-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/pstotext/pstotext-1.9-r1.ebuild,v 1.1 2006/05/08 17:36:45 ehmsen Exp $
+
+inherit eutils
+
+DESCRIPTION="extract ASCII text from a PostScript or PDF file"
+HOMEPAGE="http://www.cs.wisc.edu/~ghost/doc/pstotext.htm"
+SRC_URI="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/contrib/${P}.tar.gz"
+
+LICENSE="PSTT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND="app-arch/ncompress"
+
+RDEPEND="virtual/ghostscript"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-1.8g-dsafer.patch || die
+ # fix bug #132662
+ epatch "${FILESDIR}"/${P}-quote-chars-fix.patch || die
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install () {
+ into /usr
+ dobin pstotext
+ doman pstotext.1
+}