mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-23 13:58:24 +00:00
Ensure environment variable is set when using ECS
Previously s3fs crashed when AWS_CONTAINER_CREDENTIALS_RELATIVE_URI was not set. References #1162.
This commit is contained in:
parent
76d88f2291
commit
44d2cc15f7
@ -2678,7 +2678,12 @@ int S3fsCurl::GetIAMCredentials()
|
||||
|
||||
// url
|
||||
if(is_ecs){
|
||||
url = std::string(S3fsCurl::IAM_cred_url) + std::getenv(ECS_IAM_ENV_VAR.c_str());
|
||||
const char *env = std::getenv(ECS_IAM_ENV_VAR.c_str());
|
||||
if(env == NULL){
|
||||
S3FS_PRN_ERR("%s is not set.", ECS_IAM_ENV_VAR.c_str());
|
||||
return -EIO;
|
||||
}
|
||||
url = std::string(S3fsCurl::IAM_cred_url) + env;
|
||||
}else{
|
||||
url = std::string(S3fsCurl::IAM_cred_url) + S3fsCurl::IAM_role;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user