GeneralCompiling with shell-escape safely - or equivalent.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Lmao2
Posts: 2
Joined: Sun Aug 23, 2020 9:28 pm

Compiling with shell-escape safely - or equivalent.

Post by Lmao2 »

I need to read some files, and get some specific information from them using something like regex, at compile time. I don't think this is possible without shell-escape enabled, as i will have to run an external shell script. My problem is that i often compile files without knowing their content, so i am concerned about security.

Is it somehow possible to specify a specific program that is runable from within tex, without making every program runable?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Compiling with shell-escape safely - or equivalent.

Post by Ijon Tichy »

TeX Live provides a safe list in texmf.cnf → shell_escape_commands. However adding a shell to shell_escape_commands is never really safe. So it would be better to add --shell-escape only to the LaTeX runs of those documents you need it and you know what you are doing.

The LaTeX3 kernel packages provide regular expressions. See part XXVIII in interface3.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Lmao2
Posts: 2
Joined: Sun Aug 23, 2020 9:28 pm

Compiling with shell-escape safely - or equivalent.

Post by Lmao2 »

Thank you for your answer I did not know regex was possible I'll look into using it with something like texosquery.
Post Reply