summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib/texmfmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/lib/texmfmp.c')
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 8b898176e8a..eeb32eaf22c 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -610,8 +610,18 @@ runsystem (const char *cmd)
if (allow == 1)
status = system (cmd);
- else if (allow == 2)
+ else if (allow == 2) {
+/*
+ command including a character '|' is not allowed in
+ restricted mode for security.
+*/
+ size_t k;
+ for (k = 0; k < strlen (safecmd); k++) {
+ if (safecmd[k] == '|')
+ return 0;
+ }
status = system (safecmd);
+ }
/* Not really meaningful, but we have to manage the return value of system. */
if (status != 0)