From: <ro...@us...> - 2012-01-19 04:54:47
|
Revision: 53886 http://firebird.svn.sourceforge.net/firebird/?rev=53886&view=rev Author: robocop Date: 2012-01-19 04:54:39 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Misc. Modified Paths: -------------- firebird/trunk/doc/sql.extensions/README.merge.txt firebird/trunk/src/auth/SecureRemotePassword/Message.h firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp firebird/trunk/src/auth/SecureRemotePassword/srp.cpp firebird/trunk/src/common/BigInteger.cpp firebird/trunk/src/common/BigInteger.h firebird/trunk/src/common/isc_sync.cpp firebird/trunk/src/common/os/posix/isc_ipc.cpp firebird/trunk/src/common/sha.cpp firebird/trunk/src/common/unicode_util.cpp firebird/trunk/src/dsql/BlrWriter.cpp firebird/trunk/src/dsql/DdlNodes.epp firebird/trunk/src/dsql/DdlNodes.h firebird/trunk/src/dsql/StmtNodes.cpp firebird/trunk/src/dsql/gen.cpp firebird/trunk/src/dsql/parse.y firebird/trunk/src/jrd/Function.epp firebird/trunk/src/jrd/JrdStatement.cpp firebird/trunk/src/jrd/cch.cpp firebird/trunk/src/jrd/exe.cpp firebird/trunk/src/jrd/scl.epp firebird/trunk/src/jrd/svc.cpp firebird/trunk/src/lock/lock.cpp firebird/trunk/src/remote/client/interface.cpp firebird/trunk/src/remote/remote.cpp firebird/trunk/src/remote/remote.h firebird/trunk/src/remote/server/server.cpp firebird/trunk/src/utilities/gsec/gsec.cpp Modified: firebird/trunk/doc/sql.extensions/README.merge.txt =================================================================== --- firebird/trunk/doc/sql.extensions/README.merge.txt 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/doc/sql.extensions/README.merge.txt 2012-01-19 04:54:39 UTC (rev 53886) @@ -55,9 +55,9 @@ UPDATE is called when a record exist in the left table (INTO), otherwise INSERT is called. - As soon is decided if the source matched or not a record in the target, the set of the - correspondent (WHEN MATCHED / WHEN NOT MATCHED) statements are evaluated in the order specified, - to check its optional conditions. The first statement which have its condition evaluated to true + As soon it's decided if the source matched or not a record in the target, the set of the + corresponding (WHEN MATCHED / WHEN NOT MATCHED) statements is evaluated in the order specified, + to check their optional conditions. The first statement which has its condition evaluated to true is the one which will be executed, and the subsequent ones will be ignored. If no record is returned in the join, INSERT is not called. Modified: firebird/trunk/src/auth/SecureRemotePassword/Message.h =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/Message.h 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/auth/SecureRemotePassword/Message.h 2012-01-19 04:54:39 UTC (rev 53886) @@ -100,7 +100,7 @@ class Field { public: - Field(Message& m) + explicit Field(Message& m) : msg(m), pos(~0), nullPos(~0) { msg.add<T>(pos, nullPos); Modified: firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -608,10 +608,8 @@ bool checkCount(Firebird::IStatus* status, int* count, UCHAR item) { - unsigned char items[1]; - items[0] = item; unsigned char buffer[100]; - att->getInfo(status, 1, items, sizeof(buffer), buffer); + att->getInfo(status, 1, &item, sizeof(buffer), buffer); if (!status->isSuccess()) { Firebird::status_exception::raise(status->get()); Modified: firebird/trunk/src/auth/SecureRemotePassword/srp.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/srp.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/auth/SecureRemotePassword/srp.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -26,7 +26,7 @@ public: BigInteger prime, generator, k; - RemoteGroup(Firebird::MemoryPool&) + explicit RemoteGroup(Firebird::MemoryPool&) : prime(primeStr), generator(genStr), k() { Auth::Sha1 hash; Modified: firebird/trunk/src/common/BigInteger.cpp =================================================================== --- firebird/trunk/src/common/BigInteger.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/common/BigInteger.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -194,7 +194,7 @@ int size; CHECK_MP(mp_radix_size(const_cast<mp_int*>(&t), radix, &size)); str.resize(size - 1, ' '); - CHECK_MP(mp_toradix(const_cast<mp_int*>(&t), const_cast<char*>(str.c_str()), radix)); + CHECK_MP(mp_toradix(const_cast<mp_int*>(&t), str.begin(), radix)); } BigInteger BigInteger::modPow(const BigInteger& pow, const BigInteger& mod) const Modified: firebird/trunk/src/common/BigInteger.h =================================================================== --- firebird/trunk/src/common/BigInteger.h 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/common/BigInteger.h 2012-01-19 04:54:39 UTC (rev 53886) @@ -40,9 +40,9 @@ { public: BigInteger(); - BigInteger(const char* text, unsigned int radix = 16u); + explicit BigInteger(const char* text, unsigned int radix = 16u); BigInteger(unsigned int count, const unsigned char* bytes); - BigInteger(const Firebird::UCharBuffer& val); + explicit BigInteger(const Firebird::UCharBuffer& val); BigInteger(const BigInteger& val); // BigInteger(int numBits, Random& r); ~BigInteger(); Modified: firebird/trunk/src/common/isc_sync.cpp =================================================================== --- firebird/trunk/src/common/isc_sync.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/common/isc_sync.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -526,7 +526,7 @@ return offset == sec.offset && fn == sec.fn; } - bool bad() + bool bad() const { return offset < 0 || fn < 0; } Modified: firebird/trunk/src/common/os/posix/isc_ipc.cpp =================================================================== --- firebird/trunk/src/common/os/posix/isc_ipc.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/common/os/posix/isc_ipc.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -320,7 +320,8 @@ return NULL; // NOMEM: not handled, too difficult } #ifndef SA_SIGINFO - if (sig_w_siginfo) { + if (sig_w_siginfo) + { DEV_REPORT("SA_SIGINFO not supported"); return NULL; } Modified: firebird/trunk/src/common/sha.cpp =================================================================== --- firebird/trunk/src/common/sha.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/common/sha.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -363,7 +363,7 @@ void Sha1::process(unsigned int length, const void* bytes) { - sha_update(&handle, reinterpret_cast<const unsigned char*>(bytes), length); + sha_update(&handle, static_cast<const unsigned char*>(bytes), length); } void Sha1::getHash(UCharBuffer& hash) Modified: firebird/trunk/src/common/unicode_util.cpp =================================================================== --- firebird/trunk/src/common/unicode_util.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/common/unicode_util.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -78,7 +78,7 @@ template <typename T> void getEntryPoint(const char* name, ModuleLoader::Module* module, T& ptr) { - // ICU has too lot of schemas for entries names + // ICU has several schemas for entries names const char* patterns[] = { "%s_%d_%d", "%s_%d%d", "%s", NULL Modified: firebird/trunk/src/dsql/BlrWriter.cpp =================================================================== --- firebird/trunk/src/dsql/BlrWriter.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/dsql/BlrWriter.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -190,11 +190,12 @@ debugData.add(reinterpret_cast<const UCHAR*>(name.c_str()), len); HalfStaticArray<UCHAR, 128>& subDebugData = subFuncNode->blockScratch->debugData; - debugData.add(UCHAR(subDebugData.getCount())); - debugData.add(UCHAR(subDebugData.getCount() >> 8)); - debugData.add(UCHAR(subDebugData.getCount() >> 16)); - debugData.add(UCHAR(subDebugData.getCount() >> 24)); - debugData.add(subDebugData.begin(), ULONG(subDebugData.getCount())); + const ULONG count = ULONG(subDebugData.getCount()); + debugData.add(UCHAR(count)); + debugData.add(UCHAR(count >> 8)); + debugData.add(UCHAR(count >> 16)); + debugData.add(UCHAR(count >> 24)); + debugData.add(subDebugData.begin(), count); } void BlrWriter::putDebugSubProcedure(DeclareSubProcNode* subProcNode) Modified: firebird/trunk/src/dsql/DdlNodes.epp =================================================================== --- firebird/trunk/src/dsql/DdlNodes.epp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/dsql/DdlNodes.epp 2012-01-19 04:54:39 UTC (rev 53886) @@ -1648,19 +1648,22 @@ if (!secondPass) { FUN.RDB$ENGINE_NAME.NULL = (SSHORT) external->engine.isEmpty(); - strcpy(FUN.RDB$ENGINE_NAME, external->engine.c_str()); + //strcpy(FUN.RDB$ENGINE_NAME, external->engine.c_str()); + external->engine.copyTo(FUN.RDB$ENGINE_NAME, sizeof(FUN.RDB$ENGINE_NAME)); if (external->udfModule.length() >= sizeof(FUN.RDB$MODULE_NAME)) status_exception::raise(Arg::Gds(isc_dyn_name_longer)); FUN.RDB$MODULE_NAME.NULL = (SSHORT) external->udfModule.isEmpty(); - strcpy(FUN.RDB$MODULE_NAME, external->udfModule.c_str()); + //strcpy(FUN.RDB$MODULE_NAME, external->udfModule.c_str()); + external->udfModule.copyTo(FUN.RDB$MODULE_NAME, sizeof(FUN.RDB$MODULE_NAME)); if (external->name.length() >= sizeof(FUN.RDB$ENTRYPOINT)) status_exception::raise(Arg::Gds(isc_dyn_name_longer)); FUN.RDB$ENTRYPOINT.NULL = (SSHORT) external->name.isEmpty(); - strcpy(FUN.RDB$ENTRYPOINT, external->name.c_str()); + //strcpy(FUN.RDB$ENTRYPOINT, external->name.c_str()); + external->name.copyTo(FUN.RDB$ENTRYPOINT, sizeof(FUN.RDB$ENTRYPOINT)); } } else if (body) Modified: firebird/trunk/src/dsql/DdlNodes.h =================================================================== --- firebird/trunk/src/dsql/DdlNodes.h 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/dsql/DdlNodes.h 2012-01-19 04:54:39 UTC (rev 53886) @@ -299,7 +299,7 @@ } private: - bool isUdf() + bool isUdf() const { return external && external->udfModule.hasData(); } @@ -946,7 +946,7 @@ class DropSequenceNode : public DdlNode { public: - DropSequenceNode(MemoryPool& pool, const Firebird::MetaName&aName) + DropSequenceNode(MemoryPool& pool, const Firebird::MetaName& aName) : DdlNode(pool), name(pool, aName), silent(false) Modified: firebird/trunk/src/dsql/StmtNodes.cpp =================================================================== --- firebird/trunk/src/dsql/StmtNodes.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/dsql/StmtNodes.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -1477,6 +1477,7 @@ DeclareSubFuncNode* DeclareSubFuncNode::pass2(thread_db* tdbb, CompilerScratch* csb) { + // scope needed here? { // scope ContextPoolHolder context(tdbb, &subCsb->csb_pool); PAR_blr(tdbb, NULL, blrStart, blrLength, NULL, &subCsb, NULL, false, 0); @@ -3783,9 +3784,9 @@ dsqlScratch->beginDebug(); - // Sub routine needs a different approach than EXECUTE BLOCK. + // Sub routine needs a different approach from EXECUTE BLOCK. // EXECUTE BLOCK needs "ports", which creates DSQL messages using the client charset. - // Sub routine don't need ports and should generate BLR as declared in its metadata. + // Sub routine doesn't need ports and should generate BLR as declared in its metadata. const bool subRoutine = dsqlScratch->flags & DsqlCompilerScratch::FLAG_SUB_ROUTINE; unsigned returnsPos; Modified: firebird/trunk/src/dsql/gen.cpp =================================================================== --- firebird/trunk/src/dsql/gen.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/dsql/gen.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -310,7 +310,7 @@ } else { - bool block = statement->getType() == DsqlCompiledStatement::TYPE_EXEC_BLOCK || + const bool block = statement->getType() == DsqlCompiledStatement::TYPE_EXEC_BLOCK || statement->getType() == DsqlCompiledStatement::TYPE_SELECT_BLOCK; // To parse sub-routines messages, they must not have that begin...end pair. Modified: firebird/trunk/src/dsql/parse.y =================================================================== --- firebird/trunk/src/dsql/parse.y 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/dsql/parse.y 2012-01-19 04:54:39 UTC (rev 53886) @@ -1530,7 +1530,7 @@ } ; -domain_default_opt +domain_default_opt : /* nothing */ { $$ = NULL; } | domain_default ; @@ -1635,7 +1635,7 @@ // in preparse.cpp. // Remote options always come after initial options, so they don't need to be parsed // in preparse.cpp. They are interpreted only in the server, using this grammar. -// Altrough LENGTH is defined as a initial option, it's also used in the server. +// Although LENGTH is defined as an initial option, it's also used in the server. db_clause : db_name Modified: firebird/trunk/src/jrd/Function.epp =================================================================== --- firebird/trunk/src/jrd/Function.epp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/jrd/Function.epp 2012-01-19 04:54:39 UTC (rev 53886) @@ -273,10 +273,11 @@ if (Y.RDB$ARGUMENT_POSITION != X.RDB$RETURN_ARGUMENT) { function->fun_inputs++; - function->getInputFields().resize(Y.RDB$ARGUMENT_POSITION - - function->getOutputFields().getCount() + 1); - function->getInputFields()[Y.RDB$ARGUMENT_POSITION - - function->getOutputFields().getCount()] = parameter; + int newCount = Y.RDB$ARGUMENT_POSITION - function->getOutputFields().getCount(); + fb_assert(newCount >= 0); + + function->getInputFields().resize(newCount + 1); + function->getInputFields()[newCount] = parameter; } else { Modified: firebird/trunk/src/jrd/JrdStatement.cpp =================================================================== --- firebird/trunk/src/jrd/JrdStatement.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/jrd/JrdStatement.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -389,7 +389,7 @@ } // Check that we have enough rights to access all resources this request touches including -// resources it used indirectely via procedures or triggers. +// resources it used indirectly via procedures or triggers. void JrdStatement::verifyAccess(thread_db* tdbb) { SET_TDBB(tdbb); Modified: firebird/trunk/src/jrd/cch.cpp =================================================================== --- firebird/trunk/src/jrd/cch.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/jrd/cch.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -1059,7 +1059,8 @@ } delete[] bcb->bcb_rpt; - + bcb->bcb_rpt = NULL; // Just in case we exit with failure + while (bcb->bcb_memory.hasData()) bcb->bcb_bufferpool->deallocate(bcb->bcb_memory.pop()); Modified: firebird/trunk/src/jrd/exe.cpp =================================================================== --- firebird/trunk/src/jrd/exe.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/jrd/exe.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -640,9 +640,10 @@ try { + const JrdStatement* statement = request->getStatement(); const bool external = - (request->getStatement()->procedure && request->getStatement()->procedure->getExternal()) || - (request->getStatement()->function && request->getStatement()->function->fun_external); + (statement->procedure && statement->procedure->getExternal()) || + (statement->function && statement->function->fun_external); if (external) execute_looper(tdbb, request, transaction, jrd_req::req_sync); @@ -1127,7 +1128,7 @@ request->req_message = outMsgNode; - bool result = statement->procedure ? request->resultSet->fetch(tdbb) : true; + const bool result = statement->procedure ? request->resultSet->fetch(tdbb) : true; UCHAR* outMsg = request->getImpure<UCHAR>(outMsgNode->impureOffset); // Set the eof flag. Modified: firebird/trunk/src/jrd/scl.epp =================================================================== --- firebird/trunk/src/jrd/scl.epp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/jrd/scl.epp 2012-01-19 04:54:39 UTC (rev 53886) @@ -103,6 +103,7 @@ // Database is never requested through CMP_post_access. const char* const object_str_database = "DATABASE"; + //const char* const object_str_schema = "SCHEMA"; const char* const object_str_table = "TABLE"; const char* const object_str_package = "PACKAGE"; const char* const object_str_procedure = "PROCEDURE"; @@ -124,6 +125,7 @@ const SecObjectNamePriority priorities[] = { {object_str_database, SCL_object_database}, + //{object_str_schema, SCL_object_schema}, {object_str_table, SCL_object_table}, {object_str_package, SCL_object_package}, {object_str_procedure, SCL_object_procedure}, Modified: firebird/trunk/src/jrd/svc.cpp =================================================================== --- firebird/trunk/src/jrd/svc.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/jrd/svc.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -1903,7 +1903,8 @@ svc_service_run = serv; // currently we do not use "anonymous" service for any purposes but isc_service_query() - if (svc_user_flag == SVC_user_none) { + if (svc_user_flag == SVC_user_none) + { status_exception::raise(Arg::Gds(isc_bad_spb_form) << Arg::Gds(isc_random) << "start request for anonymous service is impossible"); } Modified: firebird/trunk/src/lock/lock.cpp =================================================================== --- firebird/trunk/src/lock/lock.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/lock/lock.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -547,7 +547,7 @@ SRQ_INIT(request->lrq_own_blocks); SRQ_INIT(request->lrq_own_pending); - SRQ_PTR request_offset = SRQ_REL_PTR(request); + const SRQ_PTR request_offset = SRQ_REL_PTR(request); // See if the lock already exists Modified: firebird/trunk/src/remote/client/interface.cpp =================================================================== --- firebird/trunk/src/remote/client/interface.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/remote/client/interface.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -3254,7 +3254,7 @@ const UCHAR* new_sdl = sdl; // CVC: Modified this horrible idea: don't touch input parameters! - // The modified (perhaps) sdl is send to the remote connection. The + // The modified (perhaps) sdl is sent to the remote connection. The // original sdl is used to process the slice data before it is sent. // (This is why both 'new_sdl' and 'sdl' are saved in the packet.) HalfStaticArray<UCHAR, 128> sdl_buffer; @@ -5720,10 +5720,10 @@ } } + const ParametersSet* ps = (op == op_service_attach ? &spbParam : &dpbParam); + HANDSHAKE_DEBUG(fprintf(stderr, "init calls authFillParametersBlock\n")); - authFillParametersBlock(cBlock, dpb, - op == op_service_attach ? &spbParam : &dpbParam, - op == op_service_attach ? NULL : &file_name, + authFillParametersBlock(cBlock, dpb, ps, op == op_service_attach ? NULL : &file_name, port); // Make attach packet @@ -5736,8 +5736,7 @@ send_packet(port, packet); - authReceiveResponse(cBlock, port, rdb, - op == op_service_attach ? &spbParam : &dpbParam, status, packet); + authReceiveResponse(cBlock, port, rdb, ps, status, packet); } catch (const Exception&) { Modified: firebird/trunk/src/remote/remote.cpp =================================================================== --- firebird/trunk/src/remote/remote.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/remote/remote.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -937,11 +937,12 @@ user_id.insertPath(CNCT_plugin_list, pluginList); } - // This is specially tricky field - user_id is limited with 255 bytes per entry, - // and we have no ways to override this limit cause it can be send to any version server. + // This is specially tricky field - user_id is limited to 255 bytes per entry, + // and we have no ways to override this limit cause it can be sent to any version server. // Therefore divide data into 254-byte parts, leaving first byte for the number of that part. // This appears more reliable than put them in strict order. unsigned int remaining = dataFromPlugin.getCount(); + fb_assert(remaining <= 254u * 256u); // paranoid check => 65024 UCHAR part = 0; UCHAR buffer[255]; const UCHAR* ptr = dataFromPlugin.begin(); @@ -957,6 +958,8 @@ ptr += step; user_id.insertBytes(CNCT_specific_data, buffer, step + 1); + if (!part) // we completed 256 loops, almost impossible but check anyway. + break; } } @@ -1007,20 +1010,19 @@ } parsed.push(list.substr(0, p)); - list = list.substr(p); + list = list.substr(p + 1); list.ltrim(" \t,;"); } } void REMOTE_makeList(Firebird::PathName& list, const Remote::ParsedList& parsed) { - list.erase(); - for (unsigned i = 0; i < parsed.getCount(); ++i) + fb_assert(parsed.hasData()); + //list.erase(); + list = parsed[0]; + for (unsigned i = 1; i < parsed.getCount(); ++i) { - if (list.hasData()) - { - list += ' '; - } + list += ' '; list += parsed[i]; } } Modified: firebird/trunk/src/remote/remote.h =================================================================== --- firebird/trunk/src/remote/remote.h 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/remote/remote.h 2012-01-19 04:54:39 UTC (rev 53886) @@ -102,7 +102,7 @@ typedef Firebird::RefPtr<Firebird::IService> ServService; -// this set of parameters help use same functions +// this set of parameters helps using same functions // for both services and databases attachments struct ParametersSet { @@ -118,16 +118,14 @@ struct Svc : public Firebird::GlobalStorage { - ServService svc_iface; // service interface - Firebird::ClumpletWriter* svc_cached_spb; // Saved auth tags from attachService() call - Firebird::Array<UCHAR> svc_wide_auth; // Server-wide (default) authentication block - + ServService svc_iface; // service interface + Firebird::ClumpletWriter* svc_cached_spb; // Saved auth tags from attachService() call + Firebird::Array<UCHAR> svc_wide_auth; // Server-wide (default) authentication block enum { SVCAUTH_NONE, // Service is not authenticated SVCAUTH_TEMP, // Service is authenticated for single task SVCAUTH_PERM // Service is authenticated permanently - } svc_auth; // Authentication state of service - + } svc_auth; // Authentication state of service Svc() : svc_iface(NULL), svc_cached_spb(NULL), svc_wide_auth(getPool()), svc_auth(SVCAUTH_NONE) @@ -606,17 +604,17 @@ private: Firebird::PathName pluginList; // To be passed to server Firebird::string userName, password; // Used by plugin, taken from DPB - // That two are legacy encrypted password, trusted auth data and so on - what plugin needs + // These two are legacy encrypted password, trusted auth data and so on - what plugin needs Firebird::UCharBuffer dataForPlugin, dataFromPlugin; - bool hasCryptKey; // DPB contains disk crypt key, may be passed only over crypted wire + bool hasCryptKey; // DPB contains disk crypt key, may be passed only over encrypted wire public: AuthClientPlugins plugins; bool authComplete; // Set as response from client that authentication accepted bool firstTime; // Invoked first time after reset - ClntAuthBlock(const Firebird::PathName* fileName); + explicit ClntAuthBlock(const Firebird::PathName* fileName); void storeDataForPlugin(unsigned int length, const unsigned char* data); void resetDataFromPlugin(); @@ -649,7 +647,7 @@ Firebird::string userName; Firebird::PathName pluginName, pluginList; - // That two may be legacy encrypted password, trusted auth data and so on + // These two may be legacy encrypted password, trusted auth data and so on Firebird::UCharBuffer dataForPlugin, dataFromPlugin; Firebird::PathName dbPath; @@ -1099,6 +1097,7 @@ { if (name == nm) return; + if (next) next->append(len, data, nm); else Modified: firebird/trunk/src/remote/server/server.cpp =================================================================== --- firebird/trunk/src/remote/server/server.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/remote/server/server.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -266,10 +266,10 @@ HANDSHAKE_DEBUG(fprintf(stderr, "ServerAuth(): db name=%s\n", dbName.c_str())); } - string x; UCharBuffer u; if (port->port_protocol >= PROTOCOL_VERSION13) { + string x; if (aPb->find(tags->plugin_name)) { aPb->getString(x); @@ -817,7 +817,7 @@ UCHAR buffer[BUFFER_XLARGE]; iface->query(&status, 0, NULL, sizeof(spb_query), spb_query, sizeof(buffer), buffer); - const char* p = reinterpret_cast<const char*>(buffer); + const UCHAR* p = buffer; if (status.isSuccess() && *p++ == isc_info_svc_svr_db_info) { @@ -827,16 +827,16 @@ { case isc_spb_dbname: { - const USHORT length = (USHORT) isc_vax_integer(p, sizeof(USHORT)); + const USHORT length = (USHORT) gds__vax_integer(p, sizeof(USHORT)); p += sizeof(USHORT) + length; } break; case isc_spb_num_att: - att_cnt = (ULONG) isc_vax_integer(p, sizeof(ULONG)); + att_cnt = (ULONG) gds__vax_integer(p, sizeof(ULONG)); p += sizeof(ULONG); break; case isc_spb_num_db: - dbs_cnt = (ULONG) isc_vax_integer(p, sizeof(ULONG)); + dbs_cnt = (ULONG) gds__vax_integer(p, sizeof(ULONG)); p += sizeof(ULONG); break; default: @@ -1375,7 +1375,7 @@ { HANDSHAKE_DEBUG(fprintf(stderr, "call plugin %s\n", port->port_srv_auth_block->getPluginName())); - AuthServerPlugins* plugins = port->port_srv_auth_block->plugins; + AuthServerPlugins* const plugins = port->port_srv_auth_block->plugins; for (; plugins->hasData(); plugins->next()) { port->port_srv_auth_block->authBlockWriter.setMethod(plugins->name()); @@ -3719,7 +3719,7 @@ case op_connect: if (!accept_connection(port, &receive->p_cnct, sendL)) { - const string& s = port->port_user_name; + //const string& s = port->port_user_name; /* if (s.hasData()) { looks like logging rejects is not good idea any more? gds__log("SERVER/process_packet: connection rejected for %s", s.c_str()); @@ -5841,7 +5841,7 @@ void SrvAuthBlock::load(Firebird::ClumpletReader& id) { - // This array is needed only to make sure that all parts of specific data is present + // This array is needed only to make sure that all parts of specific data are present UCHAR checkBytes[256]; memset(checkBytes, 0, sizeof(checkBytes)); UCHAR top = 0; @@ -5873,7 +5873,6 @@ { --len; unsigned offset = specData[0]; - if (offset + 1 > top) top = offset + 1; checkBytes[offset] = 1; Modified: firebird/trunk/src/utilities/gsec/gsec.cpp =================================================================== --- firebird/trunk/src/utilities/gsec/gsec.cpp 2012-01-19 03:32:53 UTC (rev 53885) +++ firebird/trunk/src/utilities/gsec/gsec.cpp 2012-01-19 04:54:39 UTC (rev 53886) @@ -244,7 +244,7 @@ public: GsecInfo(const char* pTrustedUser, const char* pRole, int pTrustedRole, const char* pProtocol, const char* pAddress, - Auth::UserData::AuthenticationBlock* pAuthBlock) + const Auth::UserData::AuthenticationBlock* pAuthBlock) : trustedUser(pTrustedUser), sqlRole(pRole), trustedRole(pTrustedRole), protocol(pProtocol), address(pAddress), authBytes(pAuthBlock->getCount() ? pAuthBlock->begin() : NULL), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |