[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1592-gec0b35f

[email protected] (Chris Liddell)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  ec0b35fed3de9f313c7c992844daac5f3f28618d (commit)
      from  453ef45209143ecf3c3e25dafd9fbe6698e2c5a1 (commit)

----------------------------------------------------------------------
commit ec0b35fed3de9f313c7c992844daac5f3f28618d
Author: Chris Liddell <[email protected]>
Date:   Wed Aug 21 10:56:02 2019 +0100

    Handle directory separators in access control matching
    
    On Windows, we end up dealing with a mishmash of "/" and "\" as directory
    separators, so a simple equality check isn't sufficient.
    
    Since there is already (platform specific) function for checking whether a
    string (or part thereof) is a directory separation, use it.

diff --git a/base/gpmisc.c b/base/gpmisc.c
index 386dd2b..30137b6 100644
--- a/base/gpmisc.c
+++ b/base/gpmisc.c
@@ -974,7 +974,12 @@ validate(const gs_memory_t *mem,
                  }
                 /* PATH=abcd pattern=abc */
                 break; /* No match */
-            } else if (*a != *b) {
+            } else if (*a != *b
+                       && gs_file_name_check_separator(a, 1, a)
+                       != gs_file_name_check_separator(b, 1, b)) {
+                /* On Windows we can get random combinations of "/" and "\" as directory
+                 * separators, and we want "C:\" to match C:/" hence using the pair of
+                 * gs_file_name_check_separator() calls */
                 break;
             }
             a++, b++;


Summary of changes:
 base/gpmisc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.