summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2010-05-24 14:12:02 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2010-05-24 14:12:02 +0000
commit37bbb87880e0994c7b5b24836ba3123531576b68 (patch)
treee1a7bbed58e9c0548cb9a1ea55916ac352de5802 /Build/source
parent57ea7dad48fbf2541c04e434c31bde655ada3ac4 (diff)
on win32, restricted shell escape command is always called by full path.
git-svn-id: svn://tug.org/texlive/trunk@18446 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index bffcf58a045..6e4cc6f6186 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-24 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * texmfmp.c: on win32, all restricted shell escape commands are
+ executed by fullpath.
+
2010-05-18 Karl Berry <karl@tug.org>
* printversion.c (printversionandexit): 2010.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 3454c0575aa..f2b9161a7dd 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -404,6 +404,32 @@ shell_cmd_is_allowed (const char *cmd, char **safecmd, char **cmdname)
*d++ = QUOTE;
}
*d = '\0';
+#ifdef WIN32
+ {
+ char *p, *q, *r;
+ p = *safecmd;
+ if (!(IS_DIR_SEP (p[0]) && IS_DIR_SEP (p[1])) &&
+ !(p[1] == ':' && IS_DIR_SEP (p[2]))) {
+ p = (char *) kpse_var_value ("SELFAUTOLOC");
+ if (p) {
+ r = *safecmd;
+ while (*r && !Isspace(*r))
+ r++;
+ *r = '\0';
+ r++;
+ while (*r && Isspace(*r))
+ r++;
+ if (*r)
+ q = (char *) concatn ("\"", p, "/", *safecmd, "\" ", r, NULL);
+ else
+ q = (char *) concatn ("\"", p, "/", *safecmd, "\"", NULL);
+ free (p);
+ free (*safecmd);
+ *safecmd = q;
+ }
+ }
+ }
+#endif
}
return allow;