diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-10 12:08:44 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-10 12:08:44 +0000 |
commit | 1e5f142870e048b69d0e4cc148324a5998934e23 (patch) | |
tree | fb5e782fd50c4d51f289769a2d9d9c0144537524 /Build/source/texk/web2c/luatexdir/luatex.c | |
parent | a10fd8b6f5be9646d171a0f699a0a9a152ae41fd (diff) |
Modify determination of fullpath for restricted shell escape commands (from Akira)
git-svn-id: svn://tug.org/texlive/trunk@27937 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luatex.c')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c index 190f080f59d..f0e7f4a22e0 100644 --- a/Build/source/texk/web2c/luatexdir/luatex.c +++ b/Build/source/texk/web2c/luatexdir/luatex.c @@ -353,9 +353,17 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname) { 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[1] == ':' && !IS_DIR_SEP (p[2])) { + q = xmalloc (strlen (p) + 2); + q[0] = p[0]; + q[1] = p[1]; + q[2] = '\\'; + q[3] = '\0'; + strcat (q, (p + 2)); + free (*safecmd); + *safecmd = q; + } else if (!IS_DIR_SEP (p[0]) && !(p[1] == ':' && IS_DIR_SEP (p[2]))) { + p = kpse_var_value ("SELFAUTOLOC"); if (p) { r = *safecmd; while (*r && !Isspace(*r)) |