summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
l---------Master/bin/alpha-linux/repstopdf1
l---------Master/bin/i386-cygwin/repstopdf1
l---------Master/bin/i386-linux/repstopdf1
l---------Master/bin/i386-netbsd/repstopdf1
l---------Master/bin/i386-solaris/repstopdf1
l---------Master/bin/mips-irix/repstopdf1
l---------Master/bin/powerpc-aix/repstopdf1
l---------Master/bin/powerpc-linux/repstopdf1
l---------Master/bin/sparc-linux/repstopdf1
l---------Master/bin/sparc-solaris/repstopdf1
l---------Master/bin/universal-darwin/repstopdf1
l---------Master/bin/x86_64-linux/repstopdf1
-rwxr-xr-xMaster/texmf-dist/scripts/epstopdf/epstopdf.pl55
-rw-r--r--Master/texmf/doc/man/man1/epstopdf.18
-rw-r--r--Master/texmf/doc/man/man1/epstopdf.1.pdfbin6293 -> 6455 bytes
-rw-r--r--Master/texmf/doc/man/man1/repstopdf.11
-rw-r--r--Master/texmf/doc/man/man1/repstopdf.1.pdfbin0 -> 6455 bytes
-rw-r--r--Master/tlpkg/tlpsrc/epstopdf.tlpsrc2
18 files changed, 68 insertions, 10 deletions
diff --git a/Master/bin/alpha-linux/repstopdf b/Master/bin/alpha-linux/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/alpha-linux/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/repstopdf b/Master/bin/i386-cygwin/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/i386-cygwin/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/i386-linux/repstopdf b/Master/bin/i386-linux/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/i386-linux/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/repstopdf b/Master/bin/i386-netbsd/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/i386-netbsd/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/i386-solaris/repstopdf b/Master/bin/i386-solaris/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/i386-solaris/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/mips-irix/repstopdf b/Master/bin/mips-irix/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/mips-irix/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/powerpc-aix/repstopdf b/Master/bin/powerpc-aix/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/powerpc-aix/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/powerpc-linux/repstopdf b/Master/bin/powerpc-linux/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/powerpc-linux/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/sparc-linux/repstopdf b/Master/bin/sparc-linux/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/sparc-linux/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/sparc-solaris/repstopdf b/Master/bin/sparc-solaris/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/sparc-solaris/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/universal-darwin/repstopdf b/Master/bin/universal-darwin/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/universal-darwin/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/repstopdf b/Master/bin/x86_64-linux/repstopdf
new file mode 120000
index 00000000000..859052f5166
--- /dev/null
+++ b/Master/bin/x86_64-linux/repstopdf
@@ -0,0 +1 @@
+epstopdf \ No newline at end of file
diff --git a/Master/texmf-dist/scripts/epstopdf/epstopdf.pl b/Master/texmf-dist/scripts/epstopdf/epstopdf.pl
index 4349ed87024..9bbc10c40dd 100755
--- a/Master/texmf-dist/scripts/epstopdf/epstopdf.pl
+++ b/Master/texmf-dist/scripts/epstopdf/epstopdf.pl
@@ -17,7 +17,7 @@ use strict;
# products derived from this software without specific prior written
# permission.
#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR S IS'' AND ANY EXPRESS OR
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
@@ -47,6 +47,8 @@ use strict;
#
# emacs-page
# History
+# 2009/10/14 v2.12 (Manuel Pégourié-Gonnard)
+# * Added restricted mode.
# 2009/09/27 v2.11 (Karl Berry)
# * Fixed two bugs in the (atend) handling code (Martin von Gagern)
# * Improved handling of CR line ending (Martin von Gagern)
@@ -137,6 +139,10 @@ my $title = "$program $ident\n";
my $GS = "gs";
$GS = "gswin32c" if $^O eq 'MSWin32';
+### restricted mode
+my $restricted = 0;
+$restricted = 1 if $0 =~ /repstopdf/;
+
### options
$::opt_outfile="";
$::opt_compress=1;
@@ -176,6 +182,7 @@ Options:
--autorotate=VAL set AutoRotatePages (default: $rotmsg)
Recognized VAL choices: None, All, PageByPage
For EPS files, PageByPage is equivalent to All
+ --restricted use restricted mode (default: $bool[$restricted])
Examples for producing 'test.pdf':
* $program test.eps
@@ -197,7 +204,7 @@ use Getopt::Long;
GetOptions (
"help",
"version",
- "outfile=s",
+ "outfile=s", # \ref{openout_any}
"compress!",
"debug!",
"embed!",
@@ -205,9 +212,10 @@ GetOptions (
"filter!",
"gs!",
"hires!",
- "gscmd=s",
- "res=i",
- "autorotate=s",
+ "gscmd=s", # \ref{val_gscmd}
+ "res=i", # validated by Getopt ('i' specifier)
+ "autorotate=s", # \ref{val_autorotate}
+ "restricted",
) or die $usage;
### help functions
@@ -224,6 +232,10 @@ sub errorUsage {
die "$usage\n!!! Error: @_\n";
}
+### restricted option
+$restricted = 1 if $::opt_restricted;
+debug "Restricted mode activated" if $restricted;
+
### help, version options.
if ($::opt_help) {
print $usage;
@@ -236,7 +248,6 @@ if ($::opt_version) {
exit (0);
}
-
### get input filename
my $InputFilename = "";
if ($::opt_filter) {
@@ -253,7 +264,7 @@ else {
debug "Input filename:", $InputFilename;
}
-### option compress & embed
+### options compress, embed, res, autorotate
my $GSOPTS = "-dSAFER ";
$GSOPTS .= (" -dPDFSETTINGS=/prepress -dMaxSubsetPct=100 "
. "-dSubsetFonts=true -dEmbedAllFonts=true ")
@@ -262,10 +273,11 @@ $GSOPTS .= "-dUseFlateCompression=false " unless $::opt_compress;
$GSOPTS .= "-r$::opt_res " if $::opt_res;
$resmsg= $::opt_res ? $::opt_res : "[use gs default]";
$GSOPTS .= "-dAutoRotatePages=/$::opt_autorotate " if $::opt_autorotate;
+$rotmsg = $::opt_autorotate ? $::opt_autorotate : "[use gs default]";
+# \label{val_autorotate}
die "Invalid value for autorotate: '$::opt_autorotate' (use 'All', 'None' or 'PageByPage').\n"
if ($::opt_autorotate and
not $::opt_autorotate =~ /^(None|All|PageByPage)$/);
-$rotmsg = $::opt_autorotate ? $::opt_autorotate : "[use gs default]";
### option BoundingBox types
my $BBName = "%%BoundingBox:";
@@ -296,10 +308,37 @@ else {
debug "Output filename:", $OutputFilename;
}
+### validate output file name in restricted mode \label{openout_any}
+use File::Spec::Functions qw(splitpath file_name_is_absolute);
+if ($restricted) {
+ # use the equivalent of openout_any = p
+ # (see opennameok() web2c/lib/texmfmp.c)
+ # Well, for now, be even more paranoid: don't allow absolute path at all
+ my $ok = 1;
+ # disallow opening dot-files on Unix
+ unless ($^O eq "MSWin32") {
+ my ($drive, $path, $basename) = splitpath($OutputFilename);
+ $ok = 0 if $basename =~ /^\./;
+ }
+ # disallow absolute path
+ $ok = 0 if file_name_is_absolute($OutputFilename);
+ # disallow going to parent directory
+ my $ds = ($^O eq "MSWin32") ? qr([\\/]) : qr(/);
+ $ok = 0 if $OutputFilename =~ /^\.\.$ds|$ds\.\.$ds/;
+ # we passed all tests
+ die error "Output filename '$OutputFilename' not allowed in restricted mode." unless $ok;
+}
+
### option gscmd
if ($::opt_gscmd) {
debug "Switching from $GS to $::opt_gscmd";
$GS = $::opt_gscmd;
+ # validate GS \label{val_gscmd}
+ if ($restricted) {
+ $GS =~ /^(gs|mgs|gswin32c|gs386|gsos2)$/
+ or $GS =~ /^gs[\-_]?(\d|\d[\.-_]?\d\d)c?$/
+ or die error "Value of gscmd '$GS' not allowed in restricted mode.";
+ }
}
### option gs
diff --git a/Master/texmf/doc/man/man1/epstopdf.1 b/Master/texmf/doc/man/man1/epstopdf.1
index a89e1e0e92e..fe95f676100 100644
--- a/Master/texmf/doc/man/man1/epstopdf.1
+++ b/Master/texmf/doc/man/man1/epstopdf.1
@@ -1,8 +1,8 @@
-.TH EPSTOPDF 1 "27 September 2009"
+.TH EPSTOPDF 1 "15 October 2009"
.\" $Id: epstopdf.1 15532 2009-09-28 15:55:43Z karl $
.\" man page originally by Jim Van Zandt
.SH NAME
-epstopdf \- convert an EPS file to PDF
+epstopdf, repstopdf \- convert an EPS file to PDF
.SH SYNOPSIS
\fBepstopdf\fP [\fIoptions\fP] [\fIepsfile\fP]
.SH DESCRIPTION
@@ -40,6 +40,10 @@ set image resolution (default: [use gs default])
.IP "\fB--autorotate\fP=\fIval\fP"
set AutoRotatePages (default: None); recognized \fIval\fP choices:
None, All, PageByPage. For EPS files, PageByPage is equivalent to All.
+.IP "\fB--restricted\fP=\fIval\fP"
+turn on restricted mode (default: [on for resptopdf, else off]);
+this restricts the values accepted by \fB--gscmd\fP and impose restrictions
+on the output file name similar to web2c's openout_any=p.
.IP "\fB--help\fP
display help message and exit
.IP "\fB--version\fP
diff --git a/Master/texmf/doc/man/man1/epstopdf.1.pdf b/Master/texmf/doc/man/man1/epstopdf.1.pdf
index c721151a3f6..eb46c5c1ea2 100644
--- a/Master/texmf/doc/man/man1/epstopdf.1.pdf
+++ b/Master/texmf/doc/man/man1/epstopdf.1.pdf
Binary files differ
diff --git a/Master/texmf/doc/man/man1/repstopdf.1 b/Master/texmf/doc/man/man1/repstopdf.1
new file mode 100644
index 00000000000..a48cf2cd9c3
--- /dev/null
+++ b/Master/texmf/doc/man/man1/repstopdf.1
@@ -0,0 +1 @@
+.so man1/epstopdf.1
diff --git a/Master/texmf/doc/man/man1/repstopdf.1.pdf b/Master/texmf/doc/man/man1/repstopdf.1.pdf
new file mode 100644
index 00000000000..b78b5568b29
--- /dev/null
+++ b/Master/texmf/doc/man/man1/repstopdf.1.pdf
Binary files differ
diff --git a/Master/tlpkg/tlpsrc/epstopdf.tlpsrc b/Master/tlpkg/tlpsrc/epstopdf.tlpsrc
index 231e8d80ce1..80171b8984e 100644
--- a/Master/tlpkg/tlpsrc/epstopdf.tlpsrc
+++ b/Master/tlpkg/tlpsrc/epstopdf.tlpsrc
@@ -1,2 +1,4 @@
binpattern f bin/${ARCH}/epstopdf
+binpattern f bin/${ARCH}/repstopdf
docpattern +f texmf/doc/man/man1/epstopdf.*
+docpattern +f texmf/doc/man/man1/repstopdf.*