summaryrefslogtreecommitdiff
path: root/xps
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-08-17 15:44:01 +0100
committerRobin Watts <Robin.Watts@artifex.com>2020-08-18 18:48:38 +0100
commit9619c8fc8d1e2548c737adfb7f6b8b15d49d20a4 (patch)
tree66996b49c28966cbb003ad260b236726768a676a /xps
parentdf245b46c1a5290239b2932e2a5d1bdeae710c48 (diff)
downloadghostpdl-9619c8fc8d1e2548c737adfb7f6b8b15d49d20a4.tar.gz
Bug 702744: Add windows utf-8 handling for unlink and rename.
To do this, we introduce gp_unlink and gp_rename, and call those as appropriate. Also, make gp_open_scratch_file add the file to the permit list. When such a file is closed, it will be deleted from the permit list. It will also be removed from the permit list if the file is deleted using the PS deletefile operator. On closedown, if scratch files haven't been deleted, then we'll delete them as part of the closedown of gs_lib_ctx. This means that 'purging' the control lists must not remove scratch file paths from the list. Also, ensure that gsapi callers can't maliciously (or accidentally) remove scratch path paths from the list so as to leave them around after closedown.
Diffstat (limited to 'xps')
-rw-r--r--xps/xpsjxr.c2
-rw-r--r--xps/xpstop.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/xps/xpsjxr.c b/xps/xpsjxr.c
index 68fb6415e..fa1e573e7 100644
--- a/xps/xpsjxr.c
+++ b/xps/xpsjxr.c
@@ -299,7 +299,7 @@ xps_decode_jpegxr(xps_context_t *ctx, byte *buf, int len, xps_image_t *output)
jxr_destroy_container(container);
gp_fclose(file);
- unlink(name);
+ gp_unlink(ctx->memory, name);
xps_free(ctx, name);
return gs_okay;
diff --git a/xps/xpstop.c b/xps/xpstop.c
index b706f5435..6717da985 100644
--- a/xps/xpstop.c
+++ b/xps/xpstop.c
@@ -353,7 +353,7 @@ xps_impl_process_eof(pl_interp_implementation_t *impl)
gp_fclose(instance->scratch_file);
instance->scratch_file = NULL;
code = xps_process_file(ctx, instance->scratch_name);
- unlink(instance->scratch_name);
+ gp_unlink(ctx->memory, instance->scratch_name);
if (code < 0)
{
gs_catch(code, "cannot process XPS file");