diff options
author | Andras Timar <andras.timar@collabora.com> | 2018-03-08 16:07:11 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-12 11:17:04 +0100 |
commit | 08e5950b29a57d7baef3ff598cce592ee8c2c94c (patch) | |
tree | 6a175e631895fe5c8200ae6e6590d22406bf19cb /include | |
parent | bafd367521f5deb3c7d496ec63218c42510bac32 (diff) |
Let sysadmins disable individual file format filters
It makes sense to disable a filter, as a temporary security measure,
when there is a 0-day vulnerability in it.
E.g., when 0-day found in AbiWord filter, this config snippet disables it:
<item oor:path="/org.openoffice.TypeDetection.Filter">
<node oor:name="Filters">
<node oor:name="AbiWord">
<prop oor:name="Enabled" oor:finalized="true">
<value>false</value>
</prop>
</node>
</node>
</item>
Reviewed-on: https://gerrit.libreoffice.org/50961
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 4547fa2c1e205e1989611b1c4493cbbd12541372)
Change-Id: I8b84250c7e4aac3555877d23f58ed13a2210ebfc
Reviewed-on: https://gerrit.libreoffice.org/51058
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/docfilt.hxx | 5 | ||||
-rw-r--r-- | include/tools/errcode.hxx | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx index 0a68d80e9243..6fd944f727b9 100644 --- a/include/sfx2/docfilt.hxx +++ b/include/sfx2/docfilt.hxx @@ -61,6 +61,7 @@ class SFX2_DLLPUBLIC SfxFilter sal_uIntPtr nVersion; SotClipboardFormatId lFormat; sal_uInt16 nDocIcon; + bool mbEnabled; public: SfxFilter( const OUString& rProvider, const OUString& rFilterName ); @@ -73,7 +74,8 @@ public: sal_uInt16 nDocIcon, const OUString &rMimeType, const OUString &rUserData, - const OUString& rServiceName ); + const OUString& rServiceName, + bool bEnabled = true ); ~SfxFilter(); bool IsAllowedAsTemplate() const { return bool(nFormatType & SfxFilterFlags::TEMPLATE); } @@ -118,6 +120,7 @@ public: css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception ); + bool IsEnabled() const { return mbEnabled; } }; #endif diff --git a/include/tools/errcode.hxx b/include/tools/errcode.hxx index 5a8f57af462b..a177d176c79d 100644 --- a/include/tools/errcode.hxx +++ b/include/tools/errcode.hxx @@ -241,6 +241,8 @@ inline sal_uInt32 ERRCODE_TOERROR( ErrCode x ) ERRCODE_AREA_IO) #define ERRCODE_IO_NOTSTORABLEINBINARYFORMAT CAST_TO_UINT32(39UL |ERRCODE_CLASS_FORMAT|\ ERRCODE_AREA_IO) +#define ERRCODE_IO_FILTERDISABLED CAST_TO_UINT32(40UL |ERRCODE_CLASS_FORMAT|\ + ERRCODE_AREA_IO) // FsysErrorCodes |