|
From: <ale...@us...> - 2012-01-12 13:53:20
|
Revision: 53851
http://firebird.svn.sourceforge.net/firebird/?rev=53851&view=rev
Author: alexpeshkoff
Date: 2012-01-12 13:53:11 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
Fixed multifactor auth-plugin use on server - thanks to Claudio
Modified Paths:
--------------
firebird/trunk/src/remote/remot_proto.h
firebird/trunk/src/remote/remote.cpp
firebird/trunk/src/remote/server/server.cpp
Modified: firebird/trunk/src/remote/remot_proto.h
===================================================================
--- firebird/trunk/src/remote/remot_proto.h 2012-01-12 03:34:49 UTC (rev 53850)
+++ firebird/trunk/src/remote/remot_proto.h 2012-01-12 13:53:11 UTC (rev 53851)
@@ -60,7 +60,7 @@
bool REMOTE_legacy_auth(const char* nm, int protocol);
Firebird::RefPtr<Config> REMOTE_get_config(const Firebird::PathName* dbName);
void REMOTE_parseList(Remote::ParsedList&, Firebird::PathName);
-void REMOTE_mergeList(Firebird::PathName& list, const Remote::ParsedList& parsed);
+void REMOTE_makeList(Firebird::PathName& list, const Remote::ParsedList& parsed);
void REMOTE_check_response(Firebird::IStatus* warning, Rdb* rdb, PACKET* packet);
#define HANDSHAKE_DEBUG(A)
Modified: firebird/trunk/src/remote/remote.cpp
===================================================================
--- firebird/trunk/src/remote/remote.cpp 2012-01-12 03:34:49 UTC (rev 53850)
+++ firebird/trunk/src/remote/remote.cpp 2012-01-12 13:53:11 UTC (rev 53851)
@@ -994,7 +994,7 @@
}
}
-void REMOTE_mergeList(Firebird::PathName& list, const Remote::ParsedList& parsed)
+void REMOTE_makeList(Firebird::PathName& list, const Remote::ParsedList& parsed)
{
list.erase();
for (unsigned i = 0; i < parsed.getCount(); ++i)
Modified: firebird/trunk/src/remote/server/server.cpp
===================================================================
--- firebird/trunk/src/remote/server/server.cpp 2012-01-12 03:34:49 UTC (rev 53850)
+++ firebird/trunk/src/remote/server/server.cpp 2012-01-12 13:53:11 UTC (rev 53851)
@@ -6026,13 +6026,22 @@
}
// special case - last plugin from the list on the server may be used to check
- // correctness of what previous one added to auth parameters block
- if (final[final.getCount() - 1] != onServer[onServer.getCount() - 1])
+ // correctness of what previous plugins added to auth parameters block
+ bool multiFactor = true;
+ for (unsigned sp = 0; sp < final.getCount(); ++sp)
{
+ if (final[sp] == onServer[onServer.getCount() - 1])
+ {
+ multiFactor = false;
+ break;
+ }
+ }
+ if (multiFactor)
+ {
final.push(onServer[onServer.getCount() - 1]);
}
- REMOTE_mergeList(pluginList, final);
+ REMOTE_makeList(pluginList, final);
plugins = new AuthServerPlugins(PluginType::AuthServer, FB_AUTH_SERVER_VERSION, upInfo,
myConfig, pluginList.c_str());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|