[PR #495] [MERGED] Fix invalid V4 signature on multipart copy requests #1524

Closed
opened 2026-03-04 02:00:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/495
Author: @driskell
Created: 11/13/2016
Status: Merged
Merged: 11/19/2016
Merged by: @ggtakec

Base: masterHead: fix_sse_copy


📝 Commits (1)

  • 6f68877 Fix invalid V4 signature on multipart copy requests

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 src/curl.cpp (+3 -2)

📄 Description

Multipart copy is broken it seems and keeps returning invalid signature. I discovered it is due to missing request_url in the insertV4Headers call. Once tweaked, it works perfectly.

Here is what I was experiencing before applying this PR:

Nov  4 09:09:27 app02 s3fs[29997]: > PUT /path/to.file.gz?partNumber=1&uploadId=UPLOADIDSTRING HTTP/1.1
Nov  4 09:09:27 app02 s3fs[29997]: > User-Agent: s3fs/1.80 (commit hash unknown; OpenSSL)
Nov  4 09:09:27 app02 s3fs[29997]: > Accept: */*
Nov  4 09:09:27 app02 s3fs[29997]: > Authorization: AWS4-HMAC-SHA256 Credential=CREDENTIALSTRING, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-copy-source;x-amz-copy-source-range;x-amz-date, Signature=SIGNATURESTRING
Nov  4 09:09:27 app02 s3fs[29997]: > Content-Type: application/x-gzip
Nov  4 09:09:27 app02 s3fs[29997]: > host: BUCKETNAME.s3-eu-west-1.amazonaws.com
Nov  4 09:09:27 app02 s3fs[29997]: > x-amz-content-sha256: SHA256STRING
Nov  4 09:09:27 app02 s3fs[29997]: > x-amz-copy-source: /path/to.file.gz
Nov  4 09:09:27 app02 s3fs[29997]: > x-amz-copy-source-range: bytes=0-524287999
Nov  4 09:09:27 app02 s3fs[29997]: > x-amz-date: 20161104T090927Z
Nov  4 09:09:27 app02 s3fs[29997]: > Content-Length: 0
Nov  4 09:09:27 app02 s3fs[29997]: > Expect: 100-continue
Nov  4 09:09:27 app02 s3fs[29997]: >
Nov  4 09:09:27 app02 s3fs[29997]: < HTTP/1.1 403 Forbidden
Nov  4 09:09:27 app02 s3fs[29997]: < x-amz-request-id: REQUESTIDSTRING
Nov  4 09:09:27 app02 s3fs[29997]: < x-amz-id-2: AMZID2STRING
Nov  4 09:09:27 app02 s3fs[29997]: < Content-Type: application/xml
Nov  4 09:09:27 app02 s3fs[29997]: < Transfer-Encoding: chunked
Nov  4 09:09:27 app02 s3fs[29997]: < Date: Fri, 04 Nov 2016 09:09:27 GMT
Nov  4 09:09:27 app02 s3fs[29997]: < Connection: close
Nov  4 09:09:27 app02 s3fs[29997]: < Server: AmazonS3
Nov  4 09:09:27 app02 s3fs[29997]: <
Nov  4 09:09:27 app02 s3fs[29997]: * Closing connection #0
Nov  4 09:09:27 app02 s3fs[29997]:       HTTP response code 403 was returned, returning EPERM
Nov  4 09:09:27 app02 s3fs[29997]: curl.cpp:RequestPerform(1990): Body Text: <Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>[...RETRACTED...]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/495 **Author:** [@driskell](https://github.com/driskell) **Created:** 11/13/2016 **Status:** ✅ Merged **Merged:** 11/19/2016 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `fix_sse_copy` --- ### 📝 Commits (1) - [`6f68877`](https://github.com/s3fs-fuse/s3fs-fuse/commit/6f688770fde3ac66a7cee6de552216d7792c7cc6) Fix invalid V4 signature on multipart copy requests ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/curl.cpp` (+3 -2) </details> ### 📄 Description Multipart copy is broken it seems and keeps returning invalid signature. I discovered it is due to missing request_url in the `insertV4Headers` call. Once tweaked, it works perfectly. Here is what I was experiencing before applying this PR: ``` Nov 4 09:09:27 app02 s3fs[29997]: > PUT /path/to.file.gz?partNumber=1&uploadId=UPLOADIDSTRING HTTP/1.1 Nov 4 09:09:27 app02 s3fs[29997]: > User-Agent: s3fs/1.80 (commit hash unknown; OpenSSL) Nov 4 09:09:27 app02 s3fs[29997]: > Accept: */* Nov 4 09:09:27 app02 s3fs[29997]: > Authorization: AWS4-HMAC-SHA256 Credential=CREDENTIALSTRING, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-copy-source;x-amz-copy-source-range;x-amz-date, Signature=SIGNATURESTRING Nov 4 09:09:27 app02 s3fs[29997]: > Content-Type: application/x-gzip Nov 4 09:09:27 app02 s3fs[29997]: > host: BUCKETNAME.s3-eu-west-1.amazonaws.com Nov 4 09:09:27 app02 s3fs[29997]: > x-amz-content-sha256: SHA256STRING Nov 4 09:09:27 app02 s3fs[29997]: > x-amz-copy-source: /path/to.file.gz Nov 4 09:09:27 app02 s3fs[29997]: > x-amz-copy-source-range: bytes=0-524287999 Nov 4 09:09:27 app02 s3fs[29997]: > x-amz-date: 20161104T090927Z Nov 4 09:09:27 app02 s3fs[29997]: > Content-Length: 0 Nov 4 09:09:27 app02 s3fs[29997]: > Expect: 100-continue Nov 4 09:09:27 app02 s3fs[29997]: > Nov 4 09:09:27 app02 s3fs[29997]: < HTTP/1.1 403 Forbidden Nov 4 09:09:27 app02 s3fs[29997]: < x-amz-request-id: REQUESTIDSTRING Nov 4 09:09:27 app02 s3fs[29997]: < x-amz-id-2: AMZID2STRING Nov 4 09:09:27 app02 s3fs[29997]: < Content-Type: application/xml Nov 4 09:09:27 app02 s3fs[29997]: < Transfer-Encoding: chunked Nov 4 09:09:27 app02 s3fs[29997]: < Date: Fri, 04 Nov 2016 09:09:27 GMT Nov 4 09:09:27 app02 s3fs[29997]: < Connection: close Nov 4 09:09:27 app02 s3fs[29997]: < Server: AmazonS3 Nov 4 09:09:27 app02 s3fs[29997]: < Nov 4 09:09:27 app02 s3fs[29997]: * Closing connection #0 Nov 4 09:09:27 app02 s3fs[29997]: HTTP response code 403 was returned, returning EPERM Nov 4 09:09:27 app02 s3fs[29997]: curl.cpp:RequestPerform(1990): Body Text: <Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>[...RETRACTED...] ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:00:52 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1524
No description provided.