blob: a4b4f187300a8e20bf8b634e96a64580b775c635 [file] [log] [blame]
From b814597688054a4f21cf150e3aa38549f043e81e Mon Sep 17 00:00:00 2001
From: Sean Kau <skau@chromium.org>
Date: Fri, 22 Jan 2021 15:02:27 -0800
Subject: [PATCH] Disallow -dNOSAFER
ChromiumOS only uses PPDs that run with -dSAFER. Disallow the
less safe option.
---
psi/imainarg.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/psi/imainarg.c b/psi/imainarg.c
index 30ee6cca0..454b2c809 100644
--- a/psi/imainarg.c
+++ b/psi/imainarg.c
@@ -806,6 +806,12 @@ run_stdin:
return gs_error_Fatal;
eqp = strchr(adef, '=');
+ if (strncmp(adef, "NOSAFER", 7) == 0) {
+ puts(minst->heap, "-dNOSAFER is not allowed");
+ arg_free((char *)adef, minst->heap);
+ return gs_error_Fatal;
+ }
+
if (eqp == NULL)
eqp = strchr(adef, '#');
/* Initialize the object memory, scanner, and */
--
2.30.0.280.ga3ce27912f-goog