diff --git a/src/common/call_service.cpp b/src/common/call_service.cpp index 72034949c7..e701b7d121 100644 --- a/src/common/call_service.cpp +++ b/src/common/call_service.cpp @@ -465,7 +465,7 @@ void callRemoteServiceManager(ISC_STATUS* status, { const char request[] = {isc_info_svc_get_users}; int startQuery = 0; - Auth::StackUserData uData; + Auth::UserData uData; for (;;) { diff --git a/src/common/security.h b/src/common/security.h index 8495efcee2..2851816d2e 100644 --- a/src/common/security.h +++ b/src/common/security.h @@ -155,7 +155,7 @@ private: typedef Firebird::Array AuthenticationBlock; -class UserData : +class UserData final : public Firebird::VersionedIface > { public: @@ -233,31 +233,6 @@ public: IntField u, g; }; -class StackUserData final : public UserData -{ -public: - void* operator new(size_t, void* memory) noexcept - { - return memory; - } -}; - -class DynamicUserData final : public UserData -{ -public: -#ifdef DEBUG_GDS_ALLOC - void* operator new(size_t size, Firebird::MemoryPool& pool, const char* fileName, int line) - { - return pool.allocate(size, fileName, line); - } -#else // DEBUG_GDS_ALLOC - void* operator new(size_t size, Firebird::MemoryPool& pool) - { - return pool.allocate(size); - } -#endif // DEBUG_GDS_ALLOC -}; - class Get : public Firebird::GetPlugins { public: diff --git a/src/dsql/DdlNodes.epp b/src/dsql/DdlNodes.epp index 0fa5cce0bb..e355ded4c0 100644 --- a/src/dsql/DdlNodes.epp +++ b/src/dsql/DdlNodes.epp @@ -11352,7 +11352,7 @@ void CreateAlterUserNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScra // run all statements under savepoint control AutoSavePoint savePoint(tdbb, transaction); - Auth::DynamicUserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::DynamicUserData; + Auth::UserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::UserData; MetaName text(name); if (text.isEmpty() && mode == USER_MOD) @@ -11469,7 +11469,7 @@ void DropUserNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jr // run all statements under savepoint control AutoSavePoint savePoint(tdbb, transaction); - Auth::DynamicUserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::DynamicUserData; + Auth::UserData* userData = FB_NEW_POOL(*transaction->tra_pool) Auth::UserData; string text = name.c_str(); diff --git a/src/jrd/UserManagement.cpp b/src/jrd/UserManagement.cpp index d918fde3de..d09b8a45eb 100644 --- a/src/jrd/UserManagement.cpp +++ b/src/jrd/UserManagement.cpp @@ -314,7 +314,7 @@ void UserManagement::commit() } } -USHORT UserManagement::put(Auth::DynamicUserData* userData) +USHORT UserManagement::put(Auth::UserData* userData) { const FB_SIZE_T ret = commands.getCount(); if (ret > MAX_USHORT) @@ -379,7 +379,7 @@ void UserManagement::execute(USHORT id) if (command->attr.entered() || command->op == Auth::ADDMOD_OPER) { - Auth::StackUserData cmd; + Auth::UserData cmd; cmd.op = Auth::DIS_OPER; cmd.user.set(&statusWrapper, command->userName()->get()); check(&statusWrapper); @@ -614,7 +614,7 @@ RecordBuffer* UserManagement::getList(thread_db* tdbb, jrd_rel* relation) for (FillSnapshot fillSnapshot(this); fillSnapshot.pos < managers.getCount(); ++fillSnapshot.pos) { - Auth::StackUserData u; + Auth::UserData u; u.op = Auth::DIS_OPER; *ec = managers[fillSnapshot.pos].second->execute(currentWrapper, &u, &fillSnapshot); diff --git a/src/jrd/UserManagement.h b/src/jrd/UserManagement.h index 7d7895e4b8..3334d19155 100644 --- a/src/jrd/UserManagement.h +++ b/src/jrd/UserManagement.h @@ -59,7 +59,7 @@ public: ~UserManagement(); // store userData for DFW-time processing - USHORT put(Auth::DynamicUserData* userData); + USHORT put(Auth::UserData* userData); // execute command with ID void execute(USHORT id); // commit transaction in security database @@ -71,7 +71,7 @@ public: private: thread_db* threadDbb; - Firebird::HalfStaticArray commands; + Firebird::HalfStaticArray commands; typedef Firebird::Pair > Manager; Firebird::ObjectsArray managers; Firebird::NoCaseString plugins; diff --git a/src/utilities/gsec/gsec.cpp b/src/utilities/gsec/gsec.cpp index e29f3c9ef0..f61efade02 100644 --- a/src/utilities/gsec/gsec.cpp +++ b/src/utilities/gsec/gsec.cpp @@ -308,7 +308,7 @@ namespace { public Firebird::AutoIface > { public: - explicit Callback(StackUserData* pu) + explicit Callback(UserData* pu) : u(pu) { } @@ -329,7 +329,7 @@ namespace { } private: - StackUserData* u; + UserData* u; }; } // anonymous namespace @@ -356,7 +356,7 @@ int gsec(Firebird::UtilSvc* uSvc) tsec* tdsec = &tsecInstance; tsec::putSpecific(tdsec); - StackUserData u; + UserData u; tdsec->tsec_user_data = &u; Firebird::LocalStatus lsManager; @@ -549,7 +549,7 @@ int gsec(Firebird::UtilSvc* uSvc) if (user_data->operation() == MOD_OPER && user_data->userName()->entered() && (fieldSet(&user_data->u) || fieldSet(&user_data->g) || fieldSet(&user_data->group))) { - StackUserData u; + UserData u; u.op = DIS_OPER; u.user.set(&statusWrapper, user_data->userName()->get()); check(&statusWrapper); diff --git a/src/yvalve/alt.cpp b/src/yvalve/alt.cpp index 4f2e2d2ffb..2b6e233228 100644 --- a/src/yvalve/alt.cpp +++ b/src/yvalve/alt.cpp @@ -862,7 +862,7 @@ ISC_STATUS API_ROUTINE isc_add_user(ISC_STATUS* status, const USER_SEC_DATA* inp * Return > 0 if any error occurs. * **************************************/ - Auth::StackUserData userInfo; + Auth::UserData userInfo; userInfo.op = Auth::ADD_OPER; Firebird::LocalStatus s; Firebird::CheckStatusWrapper statusWrapper(&s); @@ -925,7 +925,7 @@ ISC_STATUS API_ROUTINE isc_delete_user(ISC_STATUS* status, const USER_SEC_DATA* * Return > 0 if any error occurs. * **************************************/ - Auth::StackUserData userInfo; + Auth::UserData userInfo; userInfo.op = Auth::DEL_OPER; Firebird::LocalStatus s; Firebird::CheckStatusWrapper statusWrapper(&s); @@ -970,7 +970,7 @@ ISC_STATUS API_ROUTINE isc_modify_user(ISC_STATUS* status, const USER_SEC_DATA* * Return > 0 if any error occurs. * **************************************/ - Auth::StackUserData userInfo; + Auth::UserData userInfo; userInfo.op = Auth::MOD_OPER; Firebird::LocalStatus s; Firebird::CheckStatusWrapper statusWrapper(&s);