From: <asf...@us...> - 2011-12-24 18:08:21
|
Revision: 53751 http://firebird.svn.sourceforge.net/firebird/?rev=53751&view=rev Author: asfernandes Date: 2011-12-24 18:08:13 +0000 (Sat, 24 Dec 2011) Log Message: ----------- Misc. Modified Paths: -------------- firebird/trunk/builds/posix/Makefile.in firebird/trunk/doc/sql.extensions/README.builtin_functions.txt firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp firebird/trunk/src/auth/SecureRemotePassword/srp.cpp firebird/trunk/src/auth/SecureRemotePassword/srp.h firebird/trunk/src/auth/SecurityDatabase/LegacyHash.h firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp firebird/trunk/src/common/classes/GetPlugins.h firebird/trunk/src/common/sha.cpp firebird/trunk/src/dsql/parse.y firebird/trunk/src/include/firebird/Provider.h firebird/trunk/src/lock/lock.cpp Modified: firebird/trunk/builds/posix/Makefile.in =================================================================== --- firebird/trunk/builds/posix/Makefile.in 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/builds/posix/Makefile.in 2011-12-24 18:08:13 UTC (rev 53751) @@ -359,7 +359,7 @@ # plugins - some of them are required to build examples, use separate entry for them # -.PHONY: udr legacy_user_management trace auth_debug +.PHONY: udr legacy_user_management trace auth_debug makePluginName= $(PLUGINS)/$(LIB_PREFIX)$(1).$(SHRLIB_EXT) UDR_PLUGIN = $(call makePluginName,udr_engine) LEGACY_USER_MANAGER = $(call makePluginName,Legacy_UserManager) Modified: firebird/trunk/doc/sql.extensions/README.builtin_functions.txt =================================================================== --- firebird/trunk/doc/sql.extensions/README.builtin_functions.txt 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/doc/sql.extensions/README.builtin_functions.txt 2011-12-24 18:08:13 UTC (rev 53751) @@ -247,7 +247,7 @@ CHAR_TO_UUID( <string> ) Notes: - If you have not used this function before, its usage is discouraged. CHAR_TO_UUID2 superseds it. + If you have not used this function before, its usage is discouraged. CHAR_TO_UUID2 supersedes it. Example: select char_to_uuid('93519227-8D50-4E47-81AA-8F6678C096A1') from rdb$database; @@ -268,7 +268,7 @@ CHAR_TO_UUID2( <string> ) Notes: - This function superseds CHAR_TO_UUID. The difference between them is that CHAR_TO_UUID does a + This function supersedes CHAR_TO_UUID. The difference between them is that CHAR_TO_UUID does a byte-by-byte conversion of the ASCII string to the OCTETS one, while CHAR_TO_UUID2 converts a RFC-4122 compliant ASCII UUID to a compliant OCTETS string. @@ -874,7 +874,7 @@ UUID_TO_CHAR( <string> ) Notes: - If you have not used this function before, its usage is discouraged. UUID_TO_CHAR2 superseds it. + If you have not used this function before, its usage is discouraged. UUID_TO_CHAR2 supersedes it. Example: select uuid_to_char(gen_uuid()) from rdb$database; @@ -894,7 +894,7 @@ UUID_TO_CHAR2( <string> ) Notes: - This function superseds UUID_TO_CHAR. The difference between them is that UUID_TO_CHAR does a + This function supersedes UUID_TO_CHAR. The difference between them is that UUID_TO_CHAR does a byte-by-byte conversion of the OCTETS string to the ASCII one, while UUID_TO_CHAR2 converts a RFC-4122 compliant OCTETS UUID to a compliant ASCII string. Modified: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -34,18 +34,17 @@ namespace Auth { -class SrpClient : public Firebird::StdPlugin<IClient, FB_AUTH_CLIENT_VERSION> +class SrpClient : public StdPlugin<IClient, FB_AUTH_CLIENT_VERSION> { public: - explicit SrpClient(Firebird::IPluginConfig*) + explicit SrpClient(IPluginConfig*) : client(NULL), data(getPool()), sessionKey(getPool()) { } // IClient implementation - Result FB_CARG authenticate(Firebird::IStatus*, IClientBlock* cb); - Result FB_CARG getSessionKey(Firebird::IStatus* status, - const unsigned char** key, unsigned int* keyLen); + Result FB_CARG authenticate(IStatus*, IClientBlock* cb); + Result FB_CARG getSessionKey(IStatus* status, const unsigned char** key, unsigned int* keyLen); int FB_CARG release(); private: @@ -54,14 +53,14 @@ UCharBuffer sessionKey; }; -Result SrpClient::authenticate(Firebird::IStatus* status, IClientBlock* cb) +Result SrpClient::authenticate(IStatus* status, IClientBlock* cb) { try { if (sessionKey.hasData()) { // Why are we called when auth is completed? - (Firebird::Arg::Gds(isc_random) << "Auth sync failure - SRP's authenticate called more times than supported").raise(); + (Arg::Gds(isc_random) << "Auth sync failure - SRP's authenticate called more times than supported").raise(); } if (!client) @@ -91,7 +90,7 @@ string salt, key; unsigned charSize = *saltAndKey++; - charSize += ((unsigned)*saltAndKey++) << 8; + charSize += ((unsigned) *saltAndKey++) << 8; if (charSize > RemotePassword::SRP_SALT_SIZE * 2) { string msg; @@ -104,7 +103,7 @@ length -= (charSize + 2); charSize = *saltAndKey++; - charSize += ((unsigned)*saltAndKey++) << 8; + charSize += ((unsigned) *saltAndKey++) << 8; if (charSize + 2 != length) { string msg; @@ -125,7 +124,7 @@ cb->putData(data.length(), data.c_str()); } - catch(const Exception& ex) + catch (const Exception& ex) { ex.stuffException(status); return AUTH_FAILED; @@ -135,8 +134,7 @@ } -Result SrpClient::getSessionKey(Firebird::IStatus*, - const unsigned char** key, unsigned int* keyLen) +Result SrpClient::getSessionKey(IStatus*, const unsigned char** key, unsigned int* keyLen) { if (!sessionKey.hasData()) { @@ -161,13 +159,12 @@ namespace { - Firebird::SimpleFactory<SrpClient> factory; + SimpleFactory<SrpClient> factory; } -void registerSrpClient(Firebird::IPluginManager* iPlugin) +void registerSrpClient(IPluginManager* iPlugin) { iPlugin->registerPluginFactory(PluginType::AuthClient, RemotePassword::plugName, &factory); } } // namespace Auth - Modified: firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -115,24 +115,26 @@ void prepareDataStructures() { - const char* script[] = { -"CREATE TABLE PLG$SRP (PLG$USER_NAME SEC$USER_NAME NOT NULL PRIMARY KEY, " -"PLG$VERIFIER VARCHAR(128) CHARACTER SET OCTETS NOT NULL, " -"PLG$SALT VARCHAR(32) CHARACTER SET OCTETS NOT NULL, " -"PLG$COMMENT RDB$DESCRIPTION, PLG$FIRST SEC$NAME_PART, " -"PLG$MIDDLE SEC$NAME_PART, PLG$LAST SEC$NAME_PART)" , + const char* script[] = { + "CREATE TABLE PLG$SRP (PLG$USER_NAME SEC$USER_NAME NOT NULL PRIMARY KEY, " + "PLG$VERIFIER VARCHAR(128) CHARACTER SET OCTETS NOT NULL, " + "PLG$SALT VARCHAR(32) CHARACTER SET OCTETS NOT NULL, " + "PLG$COMMENT RDB$DESCRIPTION, PLG$FIRST SEC$NAME_PART, " + "PLG$MIDDLE SEC$NAME_PART, PLG$LAST SEC$NAME_PART)" + , + "CREATE VIEW PLG$SRP_VIEW AS " + "SELECT PLG$USER_NAME, PLG$VERIFIER, PLG$SALT, PLG$COMMENT, PLG$FIRST, PLG$MIDDLE, PLG$LAST " + "FROM PLG$SRP WHERE CURRENT_USER = 'SYSDBA' OR CURRENT_ROLE = 'RDB$ADMIN' OR CURRENT_USER = PLG$SRP.PLG$USER_NAME" + , + "GRANT ALL ON PLG$SRP to VIEW PLG$SRP_VIEW" + , + "GRANT SELECT ON PLG$SRP_VIEW to PUBLIC" + , + "GRANT UPDATE(PLG$VERIFIER, PLG$SALT, PLG$FIRST, PLG$MIDDLE, PLG$LAST) ON PLG$SRP_VIEW TO PUBLIC" + , + NULL + }; -"CREATE VIEW PLG$SRP_VIEW AS " -"SELECT PLG$USER_NAME, PLG$VERIFIER, PLG$SALT, PLG$COMMENT, PLG$FIRST, PLG$MIDDLE, PLG$LAST " -"FROM PLG$SRP WHERE CURRENT_USER = 'SYSDBA' OR CURRENT_ROLE = 'RDB$ADMIN' OR CURRENT_USER = PLG$SRP.PLG$USER_NAME", - -"GRANT ALL ON PLG$SRP to VIEW PLG$SRP_VIEW", - -"GRANT SELECT ON PLG$SRP_VIEW to PUBLIC", - -"GRANT UPDATE(PLG$VERIFIER, PLG$SALT, PLG$FIRST, PLG$MIDDLE, PLG$LAST) ON PLG$SRP_VIEW TO PUBLIC", - NULL }; - Firebird::LocalStatus s; Firebird::RefPtr<Firebird::ITransaction> ddlTran(att->startTransaction(&s, 0, NULL)); if (!s.isSuccess()) @@ -506,7 +508,7 @@ Firebird::status_exception::raise(status->get()); } } - catch(const Firebird::Exception&) + catch (const Firebird::Exception&) { printf("Exception\n"); if (stmt.hasData()) @@ -518,8 +520,8 @@ } break; - default: - return -1; + default: + return -1; } } catch (const Firebird::Exception& ex) @@ -527,7 +529,7 @@ ex.stuffException(status); return -1; -/* + /* switch(user->operation()) { case ADD_OPER: @@ -550,7 +552,7 @@ default: return GsecMsg17; } - */ + */ } return 0; Modified: firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -62,8 +62,7 @@ // IServer implementation Result FB_CARG authenticate(IStatus* status, IServerBlock* sBlock, IWriter* writerInterface); - Result FB_CARG getSessionKey(Firebird::IStatus* status, - const unsigned char** key, unsigned int* keyLen); + Result FB_CARG getSessionKey(IStatus* status, const unsigned char** key, unsigned int* keyLen); int FB_CARG release(); private: @@ -75,7 +74,7 @@ string salt; UCharBuffer sessionKey; RefPtr<IFirebirdConf> config; - const char *secDbName; + const char* secDbName; }; Result SrpServer::authenticate(IStatus* status, IServerBlock* sb, IWriter* writerInterface) @@ -158,25 +157,29 @@ const char* sql = "SELECT PLG$VERIFIER, PLG$SALT FROM PLG$SRP WHERE PLG$USER_NAME = ?"; stmt->prepare(status, tra, 0, sql, 3, 0); + if (!status->isSuccess()) { const ISC_STATUS* v = status->get(); + while (v[0] == isc_arg_gds) { if (v[1] == isc_dsql_relation_err) { Arg::Gds(isc_missing_data_structures).raise(); } + do { v += 2; } while (v[0] != isc_arg_warning && v[0] != isc_arg_gds && v[0] != isc_arg_end); } + status_exception::raise(status->get()); } Message par; - Field <VarChar<SZ_LOGIN> > login(par); + Field<VarChar<SZ_LOGIN> > login(par); login() = account.c_str(); login.null() = 0; HANDSHAKE_DEBUG(fprintf(stderr, "Srv SRP1: Ready to run statement with login '%s'\n", account.c_str())); @@ -283,8 +286,7 @@ return AUTH_FAILED; } -Result SrpServer::getSessionKey(Firebird::IStatus*, - const unsigned char** key, unsigned int* keyLen) +Result SrpServer::getSessionKey(IStatus*, const unsigned char** key, unsigned int* keyLen) { if (!sessionKey.hasData()) { @@ -318,4 +320,3 @@ } } // namespace Auth - Modified: firebird/trunk/src/auth/SecureRemotePassword/srp.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/srp.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecureRemotePassword/srp.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -218,4 +218,3 @@ #endif } // namespace Auth - Modified: firebird/trunk/src/auth/SecureRemotePassword/srp.h =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/srp.h 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecureRemotePassword/srp.h 2011-12-24 18:08:13 UTC (rev 53751) @@ -13,35 +13,35 @@ /* * Order of battle for SRP handshake: - * + * * 0. At account creation, the server generates - * a random salt and computes a password + * a random salt and computes a password * verifier from the account name, password, * and salt. -* +* * 1. Client generates random number * as private key, computes public * key. - * - * 2. Client sends server the account + * + * 2. Client sends server the account * name and its public key. * 3. Server receives account name, looks up * salt and password verifier. Server * generates random number as private key. * Server computes public key from private * key, account name, verifier, and salt. - * + * * 4. Server sends client public key and salt - * + * * 3. Client receives server public * key and computes session key * from server key, salt, account * name, and password. * 5. Server computes session key from client * public key, client name, and verifier - * + * * For full details, see http://www.ietf.org/rfc/rfc5054.txt - * + * */ class RemoteGroup; Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyHash.h =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyHash.h 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyHash.h 2011-12-24 18:08:13 UTC (rev 53751) @@ -41,7 +41,6 @@ class LegacyHash { public: - static void hash(Firebird::string& h, const Firebird::string& userName, const TEXT* passwd) { Firebird::string salt; Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -451,7 +451,8 @@ const static unsigned int INIT_KEY = ((~0) - 1); static unsigned int secDbKey = INIT_KEY; -Result SecurityDatabaseServer::authenticate(Firebird::IStatus* status, IServerBlock* sBlock, IWriter* writerInterface) +Result SecurityDatabaseServer::authenticate(Firebird::IStatus* status, IServerBlock* sBlock, + IWriter* writerInterface) { status->init(); @@ -512,7 +513,7 @@ } Result SecurityDatabaseServer::getSessionKey(Firebird::IStatus*, - const unsigned char** key, unsigned int* keyLen) + const unsigned char** key, unsigned int* keyLen) { *key = NULL; *keyLen = 0; Modified: firebird/trunk/src/common/classes/GetPlugins.h =================================================================== --- firebird/trunk/src/common/classes/GetPlugins.h 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/common/classes/GetPlugins.h 2011-12-24 18:08:13 UTC (rev 53751) @@ -47,8 +47,9 @@ { LocalStatus status; pluginSet = pluginInterface->getPlugins(&status, interfaceType, - namesList ? namesList : Config::getPlugins(interfaceType), - desiredVersion, ui, NULL); + (namesList ? namesList : Config::getPlugins(interfaceType)), + desiredVersion, ui, NULL); + if (!pluginSet) { fb_assert(!status.isSuccess()); @@ -66,8 +67,9 @@ { LocalStatus status; pluginSet = pluginInterface->getPlugins(&status, interfaceType, - namesList ? namesList : Config::getPlugins(interfaceType), - desiredVersion, ui, new FirebirdConf(knownConfig)); + (namesList ? namesList : Config::getPlugins(interfaceType)), + desiredVersion, ui, new FirebirdConf(knownConfig)); + if (!pluginSet) { fb_assert(!status.isSuccess()); Modified: firebird/trunk/src/common/sha.cpp =================================================================== --- firebird/trunk/src/common/sha.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/common/sha.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -345,7 +345,7 @@ namespace Firebird { - void Sha1::hashBased64(Firebird::string& hash, const Firebird::string& data) + void Sha1::hashBased64(string& hash, const string& data) { SHA_INFO si; sha_init(&si); @@ -395,4 +395,3 @@ } } // namespace Firebird - Modified: firebird/trunk/src/dsql/parse.y =================================================================== --- firebird/trunk/src/dsql/parse.y 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/dsql/parse.y 2011-12-24 18:08:13 UTC (rev 53751) @@ -5660,29 +5660,17 @@ internal_info : CURRENT_CONNECTION - { - $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_CONNECTION_ID)); - } + { $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_CONNECTION_ID)); } | CURRENT_TRANSACTION - { - $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_TRANSACTION_ID)); - } + { $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_TRANSACTION_ID)); } | GDSCODE - { - $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_GDSCODE)); - } + { $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_GDSCODE)); } | SQLCODE - { - $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_SQLCODE)); - } + { $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_SQLCODE)); } | SQLSTATE - { - $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_SQLSTATE)); - } + { $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_SQLSTATE)); } | ROW_COUNT - { - $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_ROWS_AFFECTED)); - } + { $$ = newNode<InternalInfoNode>(MAKE_const_slong(INFO_TYPE_ROWS_AFFECTED)); } ; sql_string Modified: firebird/trunk/src/include/firebird/Provider.h =================================================================== --- firebird/trunk/src/include/firebird/Provider.h 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/include/firebird/Provider.h 2011-12-24 18:08:13 UTC (rev 53751) @@ -115,7 +115,7 @@ { public: // Prepare flags. - static const unsigned PREPARE_PREFETCH_NONE = 0x0; + static const unsigned PREPARE_PREFETCH_NONE = 0x00; static const unsigned PREPARE_PREFETCH_TYPE = 0x01; static const unsigned PREPARE_PREFETCH_INPUT_PARAMETERS = 0x02; static const unsigned PREPARE_PREFETCH_OUTPUT_PARAMETERS = 0x04; Modified: firebird/trunk/src/lock/lock.cpp =================================================================== --- firebird/trunk/src/lock/lock.cpp 2011-12-24 17:59:53 UTC (rev 53750) +++ firebird/trunk/src/lock/lock.cpp 2011-12-24 18:08:13 UTC (rev 53751) @@ -3581,7 +3581,6 @@ CHECK(found == 1); // request is in lock's queue } - if (freed == EXPECT_inuse) { CHECK(found_pending == lock->lbl_pending_lrq_count); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |