]> git.lyx.org Git - features.git/commit
Add 'needauth' option to converters that need explicit user authorization.
authorTommaso Cucinotta <tommaso@lyx.org>
Sat, 5 Nov 2016 00:00:44 +0000 (01:00 +0100)
committerTommaso Cucinotta <tommaso@lyx.org>
Tue, 22 Nov 2016 22:54:58 +0000 (23:54 +0100)
commit244de5d2c10a990828eafdd72283fc87742dc133
tree67ef294be6b2e0cf313092938ace649c80ee2a58
parentff0c95aba639ab35a71f5d8ee347ecefbb9e71e1
Add 'needauth' option to converters that need explicit user authorization.

Addressing #10481.

This patch adds the new 'needauth' option for converters launching
external programs that are capable of running arbitrary code on behalf
of the user. These converters won't be run unless the user gives explicit
authorization, which is asked on-demand when the converter is about to
be run (question is not asked if the file is cached and calling the
converter is not needed).

The user prompt has a 3rd button so that he/she's not prompted again
for (any converter over) the same document (identified through
buffer->absFileName()).

Two preference options are added:

lyxrc.use_converter_needauth_forbidden disables any converter with
the 'needauth' option, which is meant to force user to an explicit
action via the preferences pane, before being able to use advanced
converters that can potentially bring security threats;

lyxrc.use_converter_needauth enables prompting the user for 'needauth'
converters, or bypasses the check if not enabled, falling back to the
previous behavior.

So, the first option is for maximum security, the second is for
maximum usability.
24 files changed:
lib/configure.py
src/Buffer.cpp
src/Buffer.h
src/Converter.cpp
src/Converter.h
src/LyXRC.cpp
src/LyXRC.h
src/factory.cpp
src/frontends/qt4/GuiExternal.cpp
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrefs.h
src/frontends/qt4/ui/PrefConvertersUi.ui
src/graphics/GraphicsCache.cpp
src/graphics/GraphicsCache.h
src/graphics/GraphicsCacheItem.cpp
src/graphics/GraphicsCacheItem.h
src/graphics/GraphicsConverter.cpp
src/graphics/GraphicsConverter.h
src/graphics/GraphicsLoader.cpp
src/graphics/GraphicsLoader.h
src/graphics/PreviewImage.cpp
src/graphics/PreviewImage.h
src/graphics/PreviewLoader.cpp
src/insets/RenderGraphic.cpp