Skip to content

Commit

Permalink
[CBRD-25730] Fixes an issue where authorization fails and core occurs…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
jongmin-won authored Dec 11, 2024
1 parent 99110cc commit 40eaa99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/object/authenticate_access_auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/object/authenticate_access_auth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 ()
Expand Down

0 comments on commit 40eaa99

Please sign in to comment.