From 62818eee2f9b67741fb92f19b333d6f0b4a2b51e Mon Sep 17 00:00:00 2001 From: xh Date: Mon, 28 Jul 2025 03:53:09 +0000 Subject: [PATCH] backport patches (cherry picked from commit 1d637411c679cf0bb0b1526b1ace0a03b92bab0e) --- ...ake-SFTP-handle-a-path-like-properly.patch | 34 +++++++++++++++++++ curl.spec | 9 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 backport-curl_path-make-SFTP-handle-a-path-like-properly.patch diff --git a/backport-curl_path-make-SFTP-handle-a-path-like-properly.patch b/backport-curl_path-make-SFTP-handle-a-path-like-properly.patch new file mode 100644 index 0000000..048786c --- /dev/null +++ b/backport-curl_path-make-SFTP-handle-a-path-like-properly.patch @@ -0,0 +1,34 @@ +From 0ede81dcc61844cecce8904fb4de24319afeb024 Mon Sep 17 00:00:00 2001 +From: Carlos Henrique Lima Melara +Date: Thu, 5 Jun 2025 14:29:06 +0200 +Subject: [PATCH] curl_path: make SFTP handle a path like /~ properly. + +... without a trailing slash. + +Fixes #17534 +Closes #17542 + +Conflict: lib/vssh/curl_path.c => lib/curl_path.c +curlx_dyn* => Curl_dyn* +Reference: https://github.com/curl/curl/commit/0ede81dcc61844cecce8904fb4de24319afeb024 +--- + lib/curl_path.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/lib/curl_path.c b/lib/curl_path.c +index 117d2e6009f6..474a5ecb8e27 100644 +--- a/lib/curl_path.c ++++ b/lib/curl_path.c +@@ -84,6 +84,12 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, + return CURLE_OUT_OF_MEMORY; + } + } ++ else { ++ if(Curl_dyn_add(&npath, "/")) { ++ free(working_path); ++ return CURLE_OUT_OF_MEMORY; ++ } ++ } + } + + if(Curl_dyn_len(&npath)) { diff --git a/curl.spec b/curl.spec index e5742c2..4eecbf5 100644 --- a/curl.spec +++ b/curl.spec @@ -6,7 +6,7 @@ Name: curl Version: 7.79.1 -Release: 39 +Release: 40 Summary: Curl is used in command lines or scripts to transfer data License: MIT URL: https://curl.haxx.se/ @@ -119,6 +119,7 @@ Patch105: backport-urlapi-fix-redirect-to-a-new-fragment-or-query-only-ada Patch106: backport-tool_getparam-clear-sensitive-arguments-better.patch Patch107: backport-libssh-fix-freeing-of-resources-in-disconnect.patch Patch108: backport-openssl-fix-crash-on-missing-cert-password.patch +Patch109: backport-curl_path-make-SFTP-handle-a-path-like-properly.patch BuildRequires: automake brotli-devel coreutils gcc groff krb5-devel BuildRequires: libidn2-devel libnghttp2-devel libpsl-devel @@ -287,6 +288,12 @@ rm -rf ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la %{_mandir}/man3/* %changelog +* Mon Jul 28 2025 xinghe - 7.79.1-40 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:curl_path: make SFTP handle a path like /~ properly + * Tue May 06 2025 zhouyihang - 7.79.1-39 - Type:bugfix - CVE:NA -- Gitee