Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Dec 2, 2024
1 parent b270737 commit 596691d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ void Krb5Context::init()
checkResult(error, "krb5_parse_name");
// init credential
error = krb5_get_init_creds_password(
m_ctx, m_creds, m_principal, m_config->password.c_str(), NULL, NULL, 0, NULL, NULL);
m_ctx, &m_credsObj, m_principal, m_config->password.c_str(), NULL, NULL, 0, NULL, NULL);
checkResult(error, "krb5_get_init_creds_password");
m_creds = &m_credsObj;
// init the ccache
error = krb5_cc_resolve(m_ctx, m_config->ccachePath.c_str(), &m_ccache);
checkResult(error, "krb5_cc_resolve");
Expand All @@ -54,6 +55,7 @@ void Krb5Context::checkResult(krb5_error_code const& error, std::string const& m
{
if (!error)
{
HDFS_AUTH_LOG(INFO) << LOG_DESC("init Krb5Context: ") << method << " success";
return;
}
auto msg = krb5_get_error_message(m_ctx, error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Krb5Context
ppc::protocol::Krb5AuthConfig::Ptr m_config;
krb5_context m_ctx = NULL;
krb5_principal m_principal = NULL;
krb5_creds m_credsObj;
krb5_creds* m_creds = NULL;
krb5_ccache m_ccache = NULL;
};
Expand Down

0 comments on commit 596691d

Please sign in to comment.