a890cdf
From 8abd22010eb4db0fb1b10e430d5f5d83e015ef70 Mon Sep 17 00:00:00 2001
a890cdf
From: Chris Liddell <chris.liddell@artifex.com>
a890cdf
Date: Mon, 3 Oct 2016 01:46:28 +0100
a890cdf
Subject: [PATCH] Bug 697169: Be rigorous with SAFER permissions
a890cdf
a890cdf
Once we've opened our input file from the command line, enforce the SAFER
a890cdf
rules.
a890cdf
---
a890cdf
 psi/zfile.c | 3 +++
a890cdf
 1 file changed, 3 insertions(+)
a890cdf
a890cdf
diff --git a/psi/zfile.c b/psi/zfile.c
a890cdf
index b6caea2..2c6c958 100644
a890cdf
--- a/psi/zfile.c
a890cdf
+++ b/psi/zfile.c
a890cdf
@@ -1081,6 +1081,9 @@ lib_file_open(gs_file_path_ptr  lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx
a890cdf
     gs_main_instance *minst = get_minst_from_memory(mem);
a890cdf
     int code;
a890cdf
 
a890cdf
+    if (i_ctx_p && starting_arg_file)
a890cdf
+        i_ctx_p->starting_arg_file = false;
a890cdf
+
a890cdf
     /* when starting arg files (@ files) iodev_default is not yet set */
a890cdf
     if (iodev == 0)
a890cdf
         iodev = (gx_io_device *)gx_io_device_table[0];
a890cdf
-- 
a890cdf
2.7.4
a890cdf