From 6578a9282fa9d9adc634169596a11e77effd179a Mon Sep 17 00:00:00 2001 From: Vlad Khorsun Date: Thu, 13 Jun 2024 11:08:32 +0300 Subject: [PATCH] Fixed bug #8156 : Can not specify concrete IPv6 address in ES/EDS connection string. --- src/jrd/extds/ExtDS.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jrd/extds/ExtDS.cpp b/src/jrd/extds/ExtDS.cpp index 6d4b9dcb41..7f66c8341c 100644 --- a/src/jrd/extds/ExtDS.cpp +++ b/src/jrd/extds/ExtDS.cpp @@ -115,6 +115,9 @@ Manager::~Manager() void Manager::addProvider(Provider* provider) { + // TODO: if\when usage of user providers will be implemented, + // need to check provider name for allowed chars (file system rules ?) + for (const Provider* prv = m_providers; prv; prv = prv->m_next) { if (prv->m_name == provider->m_name) { @@ -155,6 +158,15 @@ static void splitDataSourceName(thread_db* tdbb, const string& dataSource, else { FB_SIZE_T pos = dataSource.find("::"); + + // Check if it is part of IPv6 address, assume provider name can't contain square brackets + if (pos != string::npos && + dataSource.rfind("[", pos) != string::npos && + dataSource.find("]", pos) != string::npos) + { + pos = string::npos; + } + if (pos != string::npos) { prvName = dataSource.substr(0, pos);