[Libreoffice-commits] core.git: connectivity/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 24 07:33:09 UTC 2021


 connectivity/source/commontools/DriversConfig.cxx |    8 ++++++++
 connectivity/source/drivers/file/FConnection.cxx  |    2 ++
 connectivity/source/manager/mdrivermanager.cxx    |    3 +++
 3 files changed, 13 insertions(+)

New commits:
commit 9c04a7692bd3f7b7676b5109e949f2e8fe4297fe
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 23 21:07:41 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Sep 24 09:32:34 2021 +0200

    some prerequisites to use dbase import with config unavailable
    
    Change-Id: I0a7f32a69112d7ce9ffc39481154c9da346c8d24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122544
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index c95d30091184..e1d492f9f51e 100644
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -16,7 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+#include <config_fuzzers.h>
+
 #include <connectivity/DriversConfig.hxx>
+#include <o3tl/string_view.hxx>
 #include <tools/wldcrd.hxx>
 #include <comphelper/sequence.hxx>
 
@@ -146,6 +149,11 @@ DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
 
 OUString DriversConfig::getDriverFactoryName(std::u16string_view _sURL) const
 {
+#if ENABLE_FUZZERS
+    if (o3tl::starts_with(_sURL, u"sdbc:dbase:"))
+        return "com.sun.star.comp.sdbc.dbase.ODriver";
+#endif
+
     const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
     OUString sRet;
     OUString sOldPattern;
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 0fba732c9f04..283bee8fee45 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/ucb/XContentIdentifier.hpp>
 #include <tools/urlobj.hxx>
 #include <file/FCatalog.hxx>
+#include <unotools/configmgr.hxx>
 #include <unotools/pathoptions.hxx>
 #include <ucbhelper/content.hxx>
 #include <connectivity/dbcharset.hxx>
@@ -131,6 +132,7 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >&
         OUString aFileName = aDSN;
         INetURLObject aURL;
         aURL.SetSmartProtocol(INetProtocol::File);
+        if (!utl::ConfigManager::IsFuzzing())
         {
             SvtPathOptions aPathOptions;
             aFileName = aPathOptions.SubstituteVariable(aFileName);
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index 2c82ba66c727..92f1dccdc0ba 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_fuzzers.h>
 
 #include "mdrivermanager.hxx"
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
@@ -328,6 +329,7 @@ void OSDBCDriverManager::bootstrapDrivers()
 
 void OSDBCDriverManager::initializeDriverPrecedence()
 {
+#if !ENABLE_FUZZERS
     if ( m_aDriversBS.empty() )
         // nothing to do
         return;
@@ -395,6 +397,7 @@ void OSDBCDriverManager::initializeDriverPrecedence()
     {
         TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "OSDBCDriverManager::initializeDriverPrecedence: caught an exception while sorting the drivers!");
     }
+#endif
 }
 
 


More information about the Libreoffice-commits mailing list