diff --git a/src/jrd/Mapping.cpp b/src/jrd/Mapping.cpp index 6bd66c888f..8808917b91 100644 --- a/src/jrd/Mapping.cpp +++ b/src/jrd/Mapping.cpp @@ -976,25 +976,19 @@ bool mapUser(string& name, string& trusted_role, Firebird::string* auth_method, if (db && !iDb) { - const char* conf = "Providers=" CURRENT_ENGINE; - embeddedSysdba.insertString(isc_dpb_config, conf, fb_strlen(conf)); + iDb = prov->attachDatabase(&st, alias, + embeddedSysdba.getBufferLength(), embeddedSysdba.getBuffer()); - if (!iDb) + if (st->getState() & IStatus::STATE_ERRORS) { - iDb = prov->attachDatabase(&st, alias, - embeddedSysdba.getBufferLength(), embeddedSysdba.getBuffer()); + const ISC_STATUS* s = st->getErrors(); + bool missing = fb_utils::containsErrorCode(s, isc_io_error); + dbDown = fb_utils::containsErrorCode(s, isc_shutdown); + if (!(missing || dbDown)) + check("IProvider::attachDatabase", &st); - if (st->getState() & IStatus::STATE_ERRORS) - { - const ISC_STATUS* s = st->getErrors(); - bool missing = fb_utils::containsErrorCode(s, isc_io_error); - dbDown = fb_utils::containsErrorCode(s, isc_shutdown); - if (!(missing || dbDown)) - check("IProvider::attachDatabase", &st); - - // down/missing DB is not a reason to fail mapping - iDb = NULL; - } + // down/missing DB is not a reason to fail mapping + iDb = NULL; } } } diff --git a/src/remote/client/interface.cpp b/src/remote/client/interface.cpp index 925650d8b4..c6d84b8be3 100644 --- a/src/remote/client/interface.cpp +++ b/src/remote/client/interface.cpp @@ -6084,11 +6084,10 @@ static bool get_new_dpb(ClumpletWriter& dpb, const ParametersSet& par) * Analyze and prepare dpb for attachment to remote server. * **************************************/ - if (!Config::getRedirection()) - { - if (dpb.find(par.address_path)) { - status_exception::raise(Arg::Gds(isc_unavailable)); - } + bool redirection = Config::getRedirection(); + if (((!redirection) && dpb.find(par.address_path)) || dpb.find(par.map_attach)) + { + status_exception::raise(Arg::Gds(isc_unavailable)); } return dpb.find(par.user_name); diff --git a/src/remote/remote.cpp b/src/remote/remote.cpp index 874f205649..450f0aa42a 100644 --- a/src/remote/remote.cpp +++ b/src/remote/remote.cpp @@ -68,7 +68,8 @@ const ParametersSet dpbParam = isc_dpb_host_name, isc_dpb_os_user, isc_dpb_config, - isc_dpb_utf8_filename + isc_dpb_utf8_filename, + isc_dpb_map_attach }; const ParametersSet spbParam = @@ -91,7 +92,8 @@ const ParametersSet spbParam = isc_spb_host_name, isc_spb_os_user, isc_spb_config, - isc_spb_utf8_filename + isc_spb_utf8_filename, + 0 }; const ParametersSet connectParam = @@ -114,6 +116,7 @@ const ParametersSet connectParam = CNCT_host, CNCT_user, 0, + 0, 0 }; diff --git a/src/remote/remote.h b/src/remote/remote.h index b1bf399f32..c23d4dc27a 100644 --- a/src/remote/remote.h +++ b/src/remote/remote.h @@ -142,7 +142,7 @@ struct ParametersSet address_path, process_id, process_name, encrypt_key, client_version, remote_protocol, host_name, os_user, config_text, - utf8_filename; + utf8_filename, map_attach; }; extern const ParametersSet dpbParam, spbParam, connectParam;