* [PATCH proxmox] s3-client: fix double URI encoding of copy_object destination key
@ 2026-03-04 9:55 Hannes Laimer
2026-03-04 10:16 ` Christian Ebner
2026-03-05 8:37 ` applied: " Fabian Grünbichler
0 siblings, 2 replies; 3+ messages in thread
From: Hannes Laimer @ 2026-03-04 9:55 UTC (permalink / raw)
To: pbs-devel
build_uri() already calls aws_sign_v4_uri_encode() on its path argument,
so pre-encoding the destination key in copy_object() caused characters
like ':' to be encoded twice ('%3A' -> '%253A'). The server decodes the
URL path once, leaving '%3A' literally in the stored object key instead
of ':'.
The copy source header still requires explicit encoding since it is not
routed through build_uri().
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
proxmox-s3-client/src/client.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
index 83176b39..34ac3e8f 100644
--- a/proxmox-s3-client/src/client.rs
+++ b/proxmox-s3-client/src/client.rs
@@ -598,7 +598,6 @@ impl S3Client {
let copy_source = source_key.to_copy_source_key(bucket, &self.options.common_prefix);
let copy_source = aws_sign_v4_uri_encode(©_source, true);
let destination_key = destination_key.to_full_key(&self.options.common_prefix);
- let destination_key = aws_sign_v4_uri_encode(&destination_key, true);
let request = Request::builder()
.method(Method::PUT)
.uri(self.build_uri(&destination_key, &[])?)
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH proxmox] s3-client: fix double URI encoding of copy_object destination key
2026-03-04 9:55 [PATCH proxmox] s3-client: fix double URI encoding of copy_object destination key Hannes Laimer
@ 2026-03-04 10:16 ` Christian Ebner
2026-03-05 8:37 ` applied: " Fabian Grünbichler
1 sibling, 0 replies; 3+ messages in thread
From: Christian Ebner @ 2026-03-04 10:16 UTC (permalink / raw)
To: Hannes Laimer, pbs-devel
Thanks for the patch!
On 3/4/26 10:55 AM, Hannes Laimer wrote:
> build_uri() already calls aws_sign_v4_uri_encode() on its path argument,
> so pre-encoding the destination key in copy_object() caused characters
> like ':' to be encoded twice ('%3A' -> '%253A'). The server decodes the
> URL path once, leaving '%3A' literally in the stored object key instead
> of ':'.
>
> The copy source header still requires explicit encoding since it is not
> routed through build_uri().
Currently this is only used to rename corrupt chunks on the S3 backend,
therefore unnoticed since there the object keys do not contain
characters to be uri encoded.
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> proxmox-s3-client/src/client.rs | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
> index 83176b39..34ac3e8f 100644
> --- a/proxmox-s3-client/src/client.rs
> +++ b/proxmox-s3-client/src/client.rs
> @@ -598,7 +598,6 @@ impl S3Client {
> let copy_source = source_key.to_copy_source_key(bucket, &self.options.common_prefix);
> let copy_source = aws_sign_v4_uri_encode(©_source, true);
> let destination_key = destination_key.to_full_key(&self.options.common_prefix);
> - let destination_key = aws_sign_v4_uri_encode(&destination_key, true);
> let request = Request::builder()
> .method(Method::PUT)
> .uri(self.build_uri(&destination_key, &[])?)
Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* applied: [PATCH proxmox] s3-client: fix double URI encoding of copy_object destination key
2026-03-04 9:55 [PATCH proxmox] s3-client: fix double URI encoding of copy_object destination key Hannes Laimer
2026-03-04 10:16 ` Christian Ebner
@ 2026-03-05 8:37 ` Fabian Grünbichler
1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2026-03-05 8:37 UTC (permalink / raw)
To: pbs-devel, Hannes Laimer
On Wed, 04 Mar 2026 10:55:14 +0100, Hannes Laimer wrote:
> build_uri() already calls aws_sign_v4_uri_encode() on its path argument,
> so pre-encoding the destination key in copy_object() caused characters
> like ':' to be encoded twice ('%3A' -> '%253A'). The server decodes the
> URL path once, leaving '%3A' literally in the stored object key instead
> of ':'.
>
> The copy source header still requires explicit encoding since it is not
> routed through build_uri().
>
> [...]
Applied, thanks!
[1/1] s3-client: fix double URI encoding of copy_object destination key
commit: 331013a3f8821f83fb4463a59c7229b2bb756cf3
Best regards,
--
Fabian Grünbichler <f.gruenbichler@proxmox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-05 8:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-04 9:55 [PATCH proxmox] s3-client: fix double URI encoding of copy_object destination key Hannes Laimer
2026-03-04 10:16 ` Christian Ebner
2026-03-05 8:37 ` applied: " Fabian Grünbichler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox