Blame SOURCES/ghostscript-cve-2016-7977.patch

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