summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2018-03-08 16:07:11 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-12 11:17:04 +0100
commit08e5950b29a57d7baef3ff598cce592ee8c2c94c (patch)
tree6a175e631895fe5c8200ae6e6590d22406bf19cb /filter/source
parentbafd367521f5deb3c7d496ec63218c42510bac32 (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 'filter/source')
-rw-r--r--filter/source/config/cache/constant.hxx1
-rw-r--r--filter/source/config/cache/filtercache.cxx7
2 files changed, 5 insertions, 3 deletions
diff --git a/filter/source/config/cache/constant.hxx b/filter/source/config/cache/constant.hxx
index 7e8cc0218a9a..3207ad5ca8ad 100644
--- a/filter/source/config/cache/constant.hxx
+++ b/filter/source/config/cache/constant.hxx
@@ -60,6 +60,7 @@
#define PROPNAME_TEMPLATENAME "TemplateName"
#define PROPNAME_FILEFORMATVERSION "FileFormatVersion"
#define PROPNAME_EXPORTEXTENSION "ExportExtension"
+#define PROPNAME_ENABLED "Enabled"
/** @short used to identify a frame loader or detect service item
property against the configuration API and can be used
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 86d092e73b1a..297b1909a9a6 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -63,10 +63,11 @@ FilterCache::FilterCache()
, m_eFillState(E_CONTAINS_NOTHING )
{
int i = 0;
- OUString sStandardProps[9];
+ OUString sStandardProps[10];
sStandardProps[i++] = PROPNAME_USERDATA;
sStandardProps[i++] = PROPNAME_TEMPLATENAME;
+ sStandardProps[i++] = PROPNAME_ENABLED;
// E_READ_UPDATE only above
sStandardProps[i++] = PROPNAME_TYPE;
sStandardProps[i++] = PROPNAME_FILEFORMATVERSION;
@@ -79,9 +80,9 @@ FilterCache::FilterCache()
// E_READ_NOTHING -> creative nothingness.
m_aStandardProps[E_READ_STANDARD] =
- css::uno::Sequence< OUString >(sStandardProps + 2, 7);
+ css::uno::Sequence< OUString >(sStandardProps + 3, 7);
m_aStandardProps[E_READ_UPDATE] =
- css::uno::Sequence< OUString >(sStandardProps, 2);
+ css::uno::Sequence< OUString >(sStandardProps, 3);
m_aStandardProps[E_READ_ALL] =
css::uno::Sequence< OUString >(sStandardProps,
SAL_N_ELEMENTS(sStandardProps));