goel-skd opened a new pull request, #50793:
URL: https://github.com/apache/arrow/pull/50793

   ### Rationale for this change
   
   `CreateDir(..., recursive=true)` calls HeadBucket to decide whether the 
bucket needs creating. Credentials scoped to a prefix in the bucket are denied 
that call, so the directory creation fails even though the caller can write 
there.
   
   ### What changes are included in this PR?
   
   Only call HeadBucket when `allow_bucket_creation` is on. There is nothing to 
do with the answer otherwise, and a missing bucket still fails when the 
directory entry is written.
   
   ### Are these changes tested?
   
   Yes. A new test sets a bucket policy granting anonymous access to a single 
prefix, which leaves HeadBucket denied, then creates a directory under that 
prefix. It fails with the reported error without the fix.
   
   ### Are there any user-facing changes?
   
   With `allow_bucket_creation` off and a bucket that does not exist, the error 
now comes from PutObject instead of `Bucket 'x' not found. To create buckets, 
enable the allow_bucket_creation option.`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to