From 40eaa991930233c0ddbe6288f71835752d913456 Mon Sep 17 00:00:00 2001 From: jongmin-won <55681111+jongmin-won@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:11:42 +0900 Subject: [PATCH] [CBRD-25730] Fixes an issue where authorization fails and core occurs after executing the ;connect command. (#5697) http://jira.cubrid.org/browse/CBRD-25730 Fixes an issue where authorization fails and core occurs after executing the ;connect command. --- src/object/authenticate_access_auth.cpp | 11 +++++------ src/object/authenticate_access_auth.hpp | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/object/authenticate_access_auth.cpp b/src/object/authenticate_access_auth.cpp index 986eee46c1..2d104958d6 100644 --- a/src/object/authenticate_access_auth.cpp +++ b/src/object/authenticate_access_auth.cpp @@ -56,25 +56,24 @@ const int AU_TYPE_SET_LEN[] = strlen ("EXECUTE") /* DB_AUTH_EXECUTE */ }; -MOP au_auth_accessor::au_class_mop = nullptr; - au_auth_accessor::au_auth_accessor () : m_au_obj (nullptr) + , m_au_class_mop (nullptr) {} int au_auth_accessor::create_new_auth () { - if (au_class_mop == nullptr) + if (m_au_class_mop == nullptr) { - au_class_mop = sm_find_class (CT_CLASSAUTH_NAME); - if (au_class_mop == NULL) + m_au_class_mop = sm_find_class (CT_CLASSAUTH_NAME); + if (m_au_class_mop == nullptr) { er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_AU_MISSING_CLASS, 1, CT_CLASSAUTH_NAME); } } - m_au_obj = db_create_internal (au_class_mop); + m_au_obj = db_create_internal (m_au_class_mop); if (m_au_obj == NULL) { assert (er_errid () != NO_ERROR); diff --git a/src/object/authenticate_access_auth.hpp b/src/object/authenticate_access_auth.hpp index 90e57bc6aa..297e2483be 100644 --- a/src/object/authenticate_access_auth.hpp +++ b/src/object/authenticate_access_auth.hpp @@ -46,7 +46,7 @@ class au_auth_accessor { private: // TODO: thread safe? - static MOP au_class_mop; + MOP m_au_class_mop; MOP m_au_obj; @@ -72,9 +72,9 @@ class au_auth_accessor int update_auth (DB_OBJECT_TYPE obj_type, MOP grantor, MOP user, MOP obj_mop, DB_AUTH auth_type, int grant_option); int delete_auth (DB_OBJECT_TYPE obj_type, MOP grantor, MOP user, MOP obj_mop, DB_AUTH auth_type); - static MOP get_auth_class_mop () + MOP get_auth_class_mop () { - return au_class_mop; + return m_au_class_mop; } MOP get_auth_object ()