From be5735edb874c49eb94ad1af4249e8b319a07462 Mon Sep 17 00:00:00 2001 From: Timur Alperovich Date: Mon, 16 Feb 2015 16:49:53 -0800 Subject: [PATCH] Fallback to v2 signatures correctly. Missing parameter to SetSignatureV4() call in the fallback code path results in not actually falling back. --- src/curl.h | 2 +- src/s3fs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/curl.h b/src/curl.h index 0bc0e97..c59ec43 100644 --- a/src/curl.h +++ b/src/curl.h @@ -300,7 +300,7 @@ class S3fsCurl static const char* GetIAMRole(void) { return S3fsCurl::IAM_role.c_str(); } static bool SetMultipartSize(off_t size); static off_t GetMultipartSize(void) { return S3fsCurl::multipart_size; } - static bool SetSignatureV4(bool isset = true) { bool bresult = S3fsCurl::is_sigv4; S3fsCurl::is_sigv4 = isset; return bresult; } + static bool SetSignatureV4(bool isset) { bool bresult = S3fsCurl::is_sigv4; S3fsCurl::is_sigv4 = isset; return bresult; } static bool IsSignatureV4(void) { return S3fsCurl::is_sigv4; } // methods diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 2851086..cfb2cdc 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -3068,7 +3068,7 @@ static int s3fs_check_service(void) // retry to use sigv2 LOWSYSLOGPRINT(LOG_ERR, "Could not connect, so retry to connect by signature version 2."); FPRN("Could not connect, so retry to connect by signature version 2."); - S3fsCurl::SetSignatureV4(); + S3fsCurl::SetSignatureV4(false); // retry to check s3fscurl.DestroyCurlHandle();