[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 25/26: [grops]: Fix Savannah #66419.
From: |
G. Branden Robinson |
Subject: |
[groff] 25/26: [grops]: Fix Savannah #66419. |
Date: |
Thu, 14 Nov 2024 11:54:13 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 01c29f81b65d7dc77f4cc076bbfe8a9ef5cf2f12
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Nov 14 10:09:37 2024 -0600
[grops]: Fix Savannah #66419.
* src/devices/grops/psrm.cpp (resource_manager::output_prolog)
(resource_manager::supply_resource): Migrate from using
`font::open_file()` to `font::open_resource_file()`, restoring grops's
ability from groff 1.22.4 and earlier to open arbitrary file
specifications as PostScript prolog or font files.
Fixes <https://savannah.gnu.org/bugs/?66419>. Thanks to Rob Kolstad for
the report.
---
ChangeLog | 11 +++++++++++
src/devices/grops/psrm.cpp | 13 ++-----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 31a29fb59..5c4e58b4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-11-14 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/devices/grops/psrm.cpp (resource_manager::output_prolog)
+ (resource_manager::supply_resource): Migrate from using
+ `font::open_file()` to `font::open_resource_file()`, restoring
+ grops's ability from groff 1.22.4 and earlier to open arbitrary
+ file specifications as PostScript prolog or font files.
+
+ Fixes <https://savannah.gnu.org/bugs/?66419>. Thanks to Rob
+ Kolstad for the report.
+
2024-11-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/include/font.h (class font): Declare new
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index 7a6a57026..7e3d68e6d 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -293,11 +293,7 @@ void resource_manager::output_prolog(ps_output &out)
fatal("cannot update environment: %1", strerror(errno));
}
char *prologue = getenv("GROPS_PROLOGUE");
- // TODO: (?) Skip this check if `-U` (unsafe) option specified.
- if (strchr(prologue, '/') != 0 /* nullptr */)
- fatal("a '/' is not allowed in PostScript prologue file name:"
- " '%1'", prologue);
- FILE *fp = font::open_file(prologue, &path);
+ FILE *fp = font::open_resource_file(prologue, &path);
if (0 /* nullptr */ == fp)
fatal("cannot open PostScript prologue file '%1': %2", prologue,
strerror(errno));
@@ -333,13 +329,8 @@ void resource_manager::supply_resource(resource *r, int
rank,
char *path = 0 /* nullptr */;
FILE *fp = 0 /* nullptr */;
if (r->filename != 0 /* nullptr */) {
- // TODO: (?) Skip this check if `-U` (unsafe) option specified.
- if (strchr(r->filename, '/') != 0 /* nullptr */)
- fatal("a '/' is not allowed in PostScript %1 file name: '%2'",
- (r->type == RESOURCE_FONT) ? "font" : "resource",
- r->filename);
if (r->type == RESOURCE_FONT) {
- fp = font::open_file(r->filename, &path);
+ fp = font::open_resource_file(r->filename, &path);
if (0 /* nullptr */ == fp) {
error("cannot open PostScript font file '%1': %2",
r->filename, strerror(errno));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 25/26: [grops]: Fix Savannah #66419.,
G. Branden Robinson <=