Merge pull request #567 from andrewgaul/default-acl

Do not send ACL unless overridden
This commit is contained in:
Takeshi Nakatani 2017-05-09 23:03:27 +09:00 committed by GitHub
commit a22675bafd
2 changed files with 12 additions and 5 deletions

View File

@ -2611,7 +2611,9 @@ int S3fsCurl::PutHeadRequest(const char* tpath, headers_t& meta, bool is_copy)
} }
// "x-amz-acl", storage class, sse // "x-amz-acl", storage class, sse
if(!S3fsCurl::default_acl.empty()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-acl", S3fsCurl::default_acl.c_str()); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-acl", S3fsCurl::default_acl.c_str());
}
if(REDUCED_REDUNDANCY == GetStorageClass()){ if(REDUCED_REDUNDANCY == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY");
} else if(STANDARD_IA == GetStorageClass()){ } else if(STANDARD_IA == GetStorageClass()){
@ -2751,7 +2753,9 @@ int S3fsCurl::PutRequest(const char* tpath, headers_t& meta, int fd)
} }
} }
// "x-amz-acl", storage class, sse // "x-amz-acl", storage class, sse
if(!S3fsCurl::default_acl.empty()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-acl", S3fsCurl::default_acl.c_str()); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-acl", S3fsCurl::default_acl.c_str());
}
if(REDUCED_REDUNDANCY == GetStorageClass()){ if(REDUCED_REDUNDANCY == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY");
} else if(STANDARD_IA == GetStorageClass()){ } else if(STANDARD_IA == GetStorageClass()){
@ -3065,7 +3069,9 @@ int S3fsCurl::PreMultipartPostRequest(const char* tpath, headers_t& meta, string
} }
} }
// "x-amz-acl", storage class, sse // "x-amz-acl", storage class, sse
if(!S3fsCurl::default_acl.empty()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-acl", S3fsCurl::default_acl.c_str()); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-acl", S3fsCurl::default_acl.c_str());
}
if(REDUCED_REDUNDANCY == GetStorageClass()){ if(REDUCED_REDUNDANCY == GetStorageClass()){
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY"); requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "REDUCED_REDUNDANCY");
} else if(STANDARD_IA == GetStorageClass()){ } else if(STANDARD_IA == GetStorageClass()){

View File

@ -967,8 +967,9 @@ void show_help (void)
" must specify this option after -o option for bucket name.\n" " must specify this option after -o option for bucket name.\n"
"\n" "\n"
" default_acl (default=\"private\")\n" " default_acl (default=\"private\")\n"
" - the default canned acl to apply to all written s3 objects\n" " - the default canned acl to apply to all written s3 objects,\n"
" see http://aws.amazon.com/documentation/s3/ for the \n" " e.g., private, public-read. empty string means do not send\n"
" header. see http://aws.amazon.com/documentation/s3/ for the\n"
" full list of canned acls\n" " full list of canned acls\n"
"\n" "\n"
" retries (default=\"2\")\n" " retries (default=\"2\")\n"