Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled/restricted shell access does not produce human-readable error message #22

Closed
Witiko opened this issue Oct 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Witiko
Copy link
Owner

Witiko commented Oct 23, 2023

I tried compiling the following document with pdfTeX:

% (file name: test.tex)
\documentclass{article}
\usepackage{markdown}
\begin{document}

Using inline markdown:

\begin{markdown}

Hello World.

\end{markdown}
\end{document}

The result was an emergency stop and the error message displayed below. It compiles just fine with LuaTeX.

System information: I am using TeX Live 2023 (installed yesterday, October 22) on Windows 10. I got the same error message with TeX Live 2022, which was why I installed the 2023 version yesterday.

This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2023.10.22)  23 OCT 2023 10:31
entering extended mode
 restricted \write18 enabled.

...

! I can't find file `"|texlua ./test.markdown.lua"'.
<to be read again> 
                   \scan_stop: 
l.13 \end{markdown}

...

[...] perhaps the error message could be made more clear?

—originally posted by @sorsted in Witiko/markdown#365.

It definitely should, thanks for bringing this to our attention. Currently, the execution of Lua code and all error handling is delegated to the lt3luabridge package, which uses the \sys_get_shell:nnNTF expl3 function in pdfTeX to determine whether the shell is available and to either use the shell or report an error:

\msg_new:nnnn
  { luabridge }
  { level-disabled }
  {
    Shell~escape~seems~to~be~disabled
  }
  {
    You~may~need~to~run~TeX~with~the~--shell-escape~or~the~
    --enable-write18~flag,~or~write~shell_escape=t~in~the~texmf.cnf~file.
  }

However, from your report it seems that the function \sys_get_shell:nnNTF fails to properly handle the case where the shell escape is disabled/restricted and does not produce a human-readable error.

—originally posted by @Witiko in Witiko/markdown#365.

@Witiko Witiko added the bug Something isn't working label Oct 23, 2023
@Witiko
Copy link
Owner Author

Witiko commented Nov 15, 2023

I opened a ticket upstream in latex3/latex3#1339. This is likely not a bug but the intended behavior, because expl3 cannot detect the case, where shell access is restricted and the shell command is not allowed. Furthermore, this seems to affect LuaTeX as well, so i am removing the "in pdfTeX" bit from the title of the ticket.

@Witiko Witiko changed the title Disabled/restricted shell access does not produce human-readable error message in pdfTeX Disabled/restricted shell access does not produce human-readable error message Nov 15, 2023
@Witiko Witiko closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant