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

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