Skip to content

Commit

Permalink
Fixed refactoring mistakes about loading IAM credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
ggtakec committed Jan 18, 2025
1 parent be183c0 commit 0be0e5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/s3fs_cred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ bool S3fsCred::LoadIAMCredentials()
S3FS_PRN_ERR("Something error occurred, could not set IAM credentials.");
return false;
}

if(!SetIAMCredentials(cred.c_str())){
S3FS_PRN_ERR("Something error occurred, could not set IAM role name.");
return false;
}
return true;
}

Expand Down Expand Up @@ -497,8 +502,6 @@ bool S3fsCred::LoadIAMRoleFromMetaData()

bool S3fsCred::SetIAMCredentials(const char* response)
{
const std::lock_guard<std::mutex> lock(token_lock);

S3FS_PRN_INFO3("IAM credential response = \"%s\"", response);

iamcredmap_t keyval;
Expand Down
2 changes: 1 addition & 1 deletion src/s3fs_cred.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class S3fsCred

bool GetIAMCredentialsURL(std::string& url, bool check_iam_role) REQUIRES(S3fsCred::token_lock);
bool LoadIAMCredentials() REQUIRES(S3fsCred::token_lock);
bool SetIAMCredentials(const char* response);
bool SetIAMCredentials(const char* response) REQUIRES(S3fsCred::token_lock);
bool SetIAMRoleFromMetaData(const char* response);

bool SetExtCredLib(const char* arg);
Expand Down

0 comments on commit 0be0e5c

Please sign in to comment.