fix: cmd_object_put check not exists bucket#1429
Open
ChenMiaoi wants to merge 1 commit intos3tools:masterfrom
Open
fix: cmd_object_put check not exists bucket#1429ChenMiaoi wants to merge 1 commit intos3tools:masterfrom
ChenMiaoi wants to merge 1 commit intos3tools:masterfrom
Conversation
In the cmd_object_put function, after checking the type of the URL, verify whether the passed bucket exists. The reason for doing this is that in a self-built S3 Server, I attempted to upload to a non-existent bucket using s3cmd, similar to 's3cmd put hello s3://b02', where b02does not exist, but the operation still succeeded(and the file could even be downloaded). This issue arises due to a design flaw in our S3 Server. $ ./s3cmd put setup.cfg s3://b02 upload: 'setup.cfg' -> 's3://b02/setup.cfg' [1 of 1] 56 of 56 100% in 0s 11.63 KB/s done $ mc put setup.cfg myio/b02 mc: <ERROR> unable to upload. Bucket `b02` does not exist. However, similar clients like the MinIO client would directly return an error stating that the bucket b02 does not exist.Therefore, I believe it is necessary for s3cmd to include this check. $ ./s3cmd put setup.cfg s3://b02 ERROR: Bucket 'b02' does not exist Signed-off-by: chenmiao <[email protected]>
Author
|
@fviard could u do the review, thanks |
Contributor
|
Hi @ChenMiaoi - shouldn't the operation fail on the server side instead like it does on Amazon S3? Checking for the bucket existence is one thing, but what if it exists but you don't have access to it? IMO It should be the server's job to reject the request if it can't be fulfilled. Convince me why not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the cmd_object_put function, after checking the type of the URL, verify whether the passed bucket exists.
The reason for doing this is that in a self-built S3 Server, I attempted to upload to a non-existent bucket using s3cmd, similar to 's3cmd put hello s3://b02', where b02does not exist, but the operation still succeeded(and the file could even be downloaded). This issue arises due to a design flaw in our S3 Server.
However, similar clients like the MinIO client would directly return an error stating that the bucket b02 does not exist.Therefore, I believe it is necessary for s3cmd to include this check.
$ ./s3cmd put setup.cfg s3://b02 ERROR: Bucket 'b02' does not exist