diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2016-10-08 16:35:39 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2016-10-08 16:35:39 +0100 |
commit | b60d50b7567369ad856cebe1efb6cd7dd2284219 (patch) | |
tree | af4e6eca30c3015be04900ab9ba08dc640b79f7f | |
parent | 4ea759bbd40746410fb2beb82e3ba9ebb6788107 (diff) |
Bug 697193: status operator honour SAFER option
-rw-r--r-- | psi/zfile.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/psi/zfile.c b/psi/zfile.c index 2f27f82f2..be3a6a64a 100644 --- a/psi/zfile.c +++ b/psi/zfile.c | |||
@@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con | |||
209 | if (code < 0) | 209 | if (code < 0) |
210 | return code; | 210 | return code; |
211 | 211 | ||
212 | if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0) | 212 | if (pname.iodev && i_ctx_p->LockFilePermissions |
213 | return gs_error_invalidfileaccess; | 213 | && strcmp(pname.iodev->dname, "%pipe%") == 0) { |
214 | 214 | code = gs_note_error(gs_error_invalidfileaccess); | |
215 | code = check_file_permissions(i_ctx_p, fname, len, permitgroup); | 215 | } |
216 | else { | ||
217 | code = check_file_permissions(i_ctx_p, fname, len, permitgroup); | ||
218 | } | ||
216 | return code; | 219 | return code; |
217 | } | 220 | } |
218 | 221 | ||
@@ -503,8 +506,11 @@ zstatus(i_ctx_t *i_ctx_p) | |||
503 | code = gs_terminate_file_name(&pname, imemory, "status"); | 506 | code = gs_terminate_file_name(&pname, imemory, "status"); |
504 | if (code < 0) | 507 | if (code < 0) |
505 | return code; | 508 | return code; |
506 | code = (*pname.iodev->procs.file_status)(pname.iodev, | 509 | if ((code = check_file_permissions(i_ctx_p, pname.fname, pname.len, |
510 | "PermitFileReading")) >= 0) { | ||
511 | code = (*pname.iodev->procs.file_status)(pname.iodev, | ||
507 | pname.fname, &fstat); | 512 | pname.fname, &fstat); |
513 | } | ||
508 | switch (code) { | 514 | switch (code) { |
509 | case 0: | 515 | case 0: |
510 | check_ostack(4); | 516 | check_ostack(4); |