Re: Ghostscript/GhostPDL 9.28 Release Candidate 1

"Akira Kakuto" <[email protected]> Thu, 22 Aug 2019 14:40:40 +0900
Newsgroups gmane.comp.printing.ghostscript.devel
Message-ID <F1780DFD17B44972AF15F4643F5588D9@CJ3001517A>
Dear Chris,

> I fear that after the patch
> https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=935408d62057
> the new SAFER mode may not be safer.

In my test code:

#if !defined(_WIN32)
        const char *a = path;
        const char *b = control->paths[i];
#else
        char *a = path;
        char *b = control->paths[i];
        char *p, *q, *r;
        p = (char *)malloc(strlen (b) + 1);
        strcpy(p, b);
        q = p;
        r = b;
        while(*q) {
          *r = *q;
          if ((*q == '\\' || *q == '/') && *q == *(q+1))
             q++;
          q++;
          r++;
        }
        *r = '\0';
        free (p);
#endif /* _WIN32 */


ps2pdf iii.eps iii.pdf
gswin32 colorcir.ps

are OK.

gswin32c test.ps
returns with
Error: /invalidfileaccess in --run--

gswin32 article9.ps
fails with
Last OS error: Permission denied.
But this seems natural because
C:/Windows/Fonts/msgothic.ttc
may not be included in allowd paths.

gswin32 -dNOSAFER article9.ps
of course works fine in my test code.

Thus my test code seems to be SAFER.

Thanks,
Akira