From abb6c01519a0318d7165dc9dc5b7d185353f93d6 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Mon, 6 Jul 2020 03:39:12 +0200 Subject: replace usage of whitelist with allowlist Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens --- vcl/inc/driverblocklist.hxx | 6 +++--- vcl/opengl/README.opengl | 2 +- vcl/opengl/opengl_denylist_windows.xml | 4 ++-- vcl/qa/cppunit/blocklistparsertest.cxx | 18 +++++++++--------- vcl/qa/cppunit/test_blocklist_evaluate.xml | 4 ++-- vcl/qa/cppunit/test_blocklist_parse.xml | 4 ++-- vcl/skia/skia_denylist_vulkan.xml | 4 ++-- vcl/source/helper/driverblocklist.cxx | 22 +++++++++++----------- 8 files changed, 32 insertions(+), 32 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/driverblocklist.hxx b/vcl/inc/driverblocklist.hxx index a3564bd1ab79..d8f8a40dfdbd 100644 --- a/vcl/inc/driverblocklist.hxx +++ b/vcl/inc/driverblocklist.hxx @@ -77,7 +77,7 @@ enum VersionComparisonOp struct DriverInfo { DriverInfo(OperatingSystem os, const OUString& vendor, VersionComparisonOp op, - uint64_t driverVersion, bool bWhiteListed = false, + uint64_t driverVersion, bool bAllowListed = false, const char* suggestedVersion = nullptr); DriverInfo(); @@ -86,7 +86,7 @@ struct DriverInfo OUString maAdapterVendor; std::vector maDevices; - bool mbWhitelisted; + bool mbAllowlisted; VersionComparisonOp meComparisonOp; @@ -113,7 +113,7 @@ private: enum class BlockType { - WHITELIST, + ALLOWLIST, DENYLIST, UNKNOWN }; diff --git a/vcl/opengl/README.opengl b/vcl/opengl/README.opengl index ad5f31c9e5a8..d1b6cf2d1bd1 100644 --- a/vcl/opengl/README.opengl +++ b/vcl/opengl/README.opengl @@ -7,7 +7,7 @@ Environment variables used: SAL_USE_VCLPLUGIN - use the specified VCL plugin (GTK2 in this case - currently needed on Linux because the default GTK3 doesn't support OpenGL yet) -SAL_FORCEGL - enable OpenGL even if the card is whitelisted. +SAL_FORCEGL - enable OpenGL even if the card would be excluded. Other variables: diff --git a/vcl/opengl/opengl_denylist_windows.xml b/vcl/opengl/opengl_denylist_windows.xml index 7419be7c5d8b..e2025c94a624 100644 --- a/vcl/opengl/opengl_denylist_windows.xml +++ b/vcl/opengl/opengl_denylist_windows.xml @@ -18,8 +18,8 @@ --> - - + + diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx index 1a22d61e3577..b79de071d319 100644 --- a/vcl/qa/cppunit/blocklistparsertest.cxx +++ b/vcl/qa/cppunit/blocklistparsertest.cxx @@ -46,46 +46,46 @@ void BlocklistParserTest::testParse() size_t i = 0; - for (bool bIsWhitelisted : {true, false}) + for (bool bIsAllowlisted : {true, false}) { DriverInfo& aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorAll), aDriveInfo.maAdapterVendor); // "all" CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_LESS_THAN, aDriveInfo.meComparisonOp); CPPUNIT_ASSERT_EQUAL(V(10,20,30,40), aDriveInfo.mnDriverVersion); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorNVIDIA), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_EQUAL, aDriveInfo.meComparisonOp); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorMicrosoft), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_NOT_EQUAL, aDriveInfo.meComparisonOp); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(OUString("0xcafe"), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_NOT_EQUAL, aDriveInfo.meComparisonOp); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorAll), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_BETWEEN_EXCLUSIVE, aDriveInfo.meComparisonOp); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorAll), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_BETWEEN_INCLUSIVE, aDriveInfo.meComparisonOp); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorAll), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_BETWEEN_INCLUSIVE_START, aDriveInfo.meComparisonOp); aDriveInfo = aDriveInfos[i++]; - CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(bIsAllowlisted, aDriveInfo.mbAllowlisted); CPPUNIT_ASSERT_EQUAL(GetVendorId(VendorAll), aDriveInfo.maAdapterVendor); CPPUNIT_ASSERT_EQUAL(VersionComparisonOp::DRIVER_COMPARISON_IGNORED, aDriveInfo.meComparisonOp); } diff --git a/vcl/qa/cppunit/test_blocklist_evaluate.xml b/vcl/qa/cppunit/test_blocklist_evaluate.xml index 7c0527f849ec..9184a9c9bd30 100644 --- a/vcl/qa/cppunit/test_blocklist_evaluate.xml +++ b/vcl/qa/cppunit/test_blocklist_evaluate.xml @@ -18,8 +18,8 @@ --> - - + + diff --git a/vcl/qa/cppunit/test_blocklist_parse.xml b/vcl/qa/cppunit/test_blocklist_parse.xml index 212e61bd8443..9a0f6acc574f 100644 --- a/vcl/qa/cppunit/test_blocklist_parse.xml +++ b/vcl/qa/cppunit/test_blocklist_parse.xml @@ -8,7 +8,7 @@ --> - + @@ -33,7 +33,7 @@ - + diff --git a/vcl/skia/skia_denylist_vulkan.xml b/vcl/skia/skia_denylist_vulkan.xml index 4c62ca4b04a9..43143548cd5a 100644 --- a/vcl/skia/skia_denylist_vulkan.xml +++ b/vcl/skia/skia_denylist_vulkan.xml @@ -18,8 +18,8 @@ --> - - + + diff --git a/vcl/source/helper/driverblocklist.cxx b/vcl/source/helper/driverblocklist.cxx index 09ce2f9b7165..49bc819b54d6 100644 --- a/vcl/source/helper/driverblocklist.cxx +++ b/vcl/source/helper/driverblocklist.cxx @@ -372,13 +372,13 @@ void Parser::handleDevices(DriverInfo& rDriver, xmlreader::XmlReader& rReader) void Parser::handleEntry(DriverInfo& rDriver, xmlreader::XmlReader& rReader) { - if (meBlockType == BlockType::WHITELIST) + if (meBlockType == BlockType::ALLOWLIST) { - rDriver.mbWhitelisted = true; + rDriver.mbAllowlisted = true; } else if (meBlockType == BlockType::DENYLIST) { - rDriver.mbWhitelisted = false; + rDriver.mbAllowlisted = false; } else if (meBlockType == BlockType::UNKNOWN) { @@ -484,9 +484,9 @@ void Parser::handleContent(xmlreader::XmlReader& rReader) if (res == xmlreader::XmlReader::Result::Begin) { - if (name == "whitelist") + if (name == "allowlist") { - meBlockType = BlockType::WHITELIST; + meBlockType = BlockType::ALLOWLIST; handleList(rReader); } else if (name == "denylist") @@ -504,7 +504,7 @@ void Parser::handleContent(xmlreader::XmlReader& rReader) } else if (res == xmlreader::XmlReader::Result::End) { - if (name == "whitelist" || name == "denylist") + if (name == "allowlist" || name == "denylist") { meBlockType = BlockType::UNKNOWN; } @@ -562,7 +562,7 @@ const uint64_t allDriverVersions = ~(uint64_t(0)); DriverInfo::DriverInfo() : meOperatingSystem(DRIVER_OS_UNKNOWN) , maAdapterVendor(GetVendorId(VendorAll)) - , mbWhitelisted(false) + , mbAllowlisted(false) , meComparisonOp(DRIVER_COMPARISON_IGNORED) , mnDriverVersion(0) , mnDriverVersionMax(0) @@ -570,11 +570,11 @@ DriverInfo::DriverInfo() } DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor, VersionComparisonOp op, - uint64_t driverVersion, bool bWhitelisted, + uint64_t driverVersion, bool bAllowlisted, const char* suggestedVersion /* = nullptr */) : meOperatingSystem(os) , maAdapterVendor(vendor) - , mbWhitelisted(bWhitelisted) + , mbAllowlisted(bAllowlisted) , meComparisonOp(op) , mnDriverVersion(driverVersion) , mnDriverVersionMax(0) @@ -658,9 +658,9 @@ bool FindBlocklistedDeviceInList(std::vector& aDeviceInfos, if (match || aDeviceInfos[i].mnDriverVersion == allDriverVersions) { // white listed drivers - if (aDeviceInfos[i].mbWhitelisted) + if (aDeviceInfos[i].mbAllowlisted) { - SAL_INFO("vcl.driver", "whitelisted driver"); + SAL_INFO("vcl.driver", "allowlisted driver"); return false; } -- cgit