summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-10-23 22:18:37 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-10-23 22:18:37 +0000
commit62087581f05ba06054be6b589fd81da692d5e16a (patch)
tree2352c5ef5392c317dfca4ae61026d5c6318c6bf1 /Build/source/texk/kpathsea
parent8d5f67188f1204985ace3fd986e21a9d97326850 (diff)
More than one directory separators in filename+2 should not exist
in \\?\ form of absolute path (w32 only). git-svn-id: svn://tug.org/texlive/trunk@56741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog5
-rw-r--r--Build/source/texk/kpathsea/knj.c26
-rw-r--r--Build/source/texk/kpathsea/readable.c13
3 files changed, 44 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index e6e3b70c4d1..a4d3b1b64ea 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,8 @@
+2020-10-24 Akira Kakuto <kakuto@w32tex.org>
+
+ * readable.c, knj.c: More than one directory separators in
+ filename+2 should not exist in \\?\ form of absolute path.
+
2020-08-26 Karl Berry <karl@tug.org>
* texmf.cnf (save_size): double to 200,000. Needed with
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c
index 9440438b0f5..0498319c606 100644
--- a/Build/source/texk/kpathsea/knj.c
+++ b/Build/source/texk/kpathsea/knj.c
@@ -127,12 +127,25 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode)
Windows, if it really exists and input name is given in
full-absolute path in a command line.
/./ , /../, \.\, \..\ should be excluded. (2020/06/06)
+ More than one directory separators should be excluded. (2020/10/24)
*/
fnn = xmalloc(len + 10);
p = strstr(filename, ".\\");
if (!p) {
p = strstr(filename, "./");
}
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "//");
+ }
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "\\\\");
+ }
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "\\/");
+ }
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "/\\");
+ }
if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
(filename[0] == '\\' && filename[1] == '\\' &&
filename[2] != '?'))) {
@@ -192,12 +205,25 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode)
Windows, if it really exists and input name is given in
full-absolute path in a command line.
/./ , /../, \.\, \..\ should be excluded. (2020/06/06)
+ More than one directory separators should be excluded. (2020/10/24)
*/
fnn = xmalloc(len + 10);
p = strstr(filename, ".\\");
if (!p) {
p = strstr(filename, "./");
}
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "//");
+ }
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "\\\\");
+ }
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "\\/");
+ }
+ if (!p && len > 2) {
+ p = strstr(filename + 2, "/\\");
+ }
if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
(filename[0] == '\\' && filename[1] == '\\' &&
filename[2] != '?'))) {
diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c
index dc83f36bd28..182a5e69a16 100644
--- a/Build/source/texk/kpathsea/readable.c
+++ b/Build/source/texk/kpathsea/readable.c
@@ -51,11 +51,24 @@ READABLE(kpathsea kpse, const_string fn, unsigned int st)
Windows, if it really exists and input name is given in
full-absolute path in a command line.
/../, /./, \..\, \.\ should be excluded (2020/06/06)
+ More than one directory separators should be excluded. (2020/10/24)
*/
p = strstr(fn, ".\\");
if (!p) {
p = strstr(fn, "./");
}
+ if (!p && len > 2) {
+ p = strstr(fn + 2, "//");
+ }
+ if (!p && len > 2) {
+ p = strstr(fn + 2, "\\\\");
+ }
+ if (!p && len > 2) {
+ p = strstr(fn + 2, "\\/");
+ }
+ if (!p && len > 2) {
+ p = strstr(fn + 2, "/\\");
+ }
if (!p && len > 2 && ((fn[0] == '/' && fn[1] == '/') ||
(fn[0] == '\\' && fn[1] == '\\' && fn[2] != '?'))) {
fn += 2;