From ddf81b4e190deaf40fef2ab44fdbe1cbff63597a Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sat, 23 Sep 2023 16:18:28 +0200 Subject: [PATCH] Amend 12e3d46b Also account for alerts regarding documents that are explicitly allowed to execute external commands through the settings. --- src/Converter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Converter.cpp b/src/Converter.cpp index f9e627bf86..881aac6bd3 100644 --- a/src/Converter.cpp +++ b/src/Converter.cpp @@ -336,21 +336,23 @@ bool Converters::checkAuth(Converter const & conv, string const & doc_fname, ? (has_token ? conv_command.insert(token_pos, "-shell-escape ") : conv_command.append(" -shell-escape")) : conv_command; + // Only change font if gui is available otherwise Qt6 crashes + string const cmd = use_gui ? "" + command + "" : command; docstring const security_warning = (use_shell_escape ? bformat(_("

The following LaTeX backend has been requested " "to allow execution of external programs:

" - "

%1$s

" + "

%1$s

" "

The external programs can execute arbitrary commands on " "your system, including dangerous ones, if instructed to do " "so by a maliciously crafted LyX document.

"), - from_utf8(command)) + from_utf8(cmd)) : bformat(_("

The requested operation requires the use of a " "converter from %2$s to %3$s:

" - "

%1$s

" + "

%1$s

" "

This external program can execute arbitrary commands on " "your system, including dangerous ones, if instructed to do " "so by a maliciously crafted LyX document.

"), - from_utf8(command), from_utf8(conv.from()), + from_utf8(cmd), from_utf8(conv.from()), from_utf8(conv.to()))); if (lyxrc.use_converter_needauth_forbidden && !use_shell_escape) { frontend::Alert::error(