all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [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
  0 siblings, 1 reply; 2+ 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(&copy_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] 2+ 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
  0 siblings, 0 replies; 2+ 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(&copy_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] 2+ messages in thread

end of thread, other threads:[~2026-03-04 10:15 UTC | newest]

Thread overview: 2+ 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal