summarylogtreecommitdiffstats
path: root/0001-libalpm-invalidate-curl-data-in-child.patch
blob: a0efb9d302b998a3981e6aae4e32121c32990d65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 21b8d8a21a03e0d44294626f7222adda6b48dfac Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Thu, 30 Apr 2026 12:31:13 +0200
Subject: [PATCH 1/1] libalpm: invalidate curl data in child

Touching that data inside the child makes it crash. So let's invalidate
and ignore it there.

https://github.com/curl/curl/issues/21466
---
 lib/libalpm/util.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 6739161b..8a99ef87 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -673,6 +673,11 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
 			close(cwdfd);
 		}
 
+#ifdef HAVE_LIBCURL
+		/* invalidate the curl data - we must not touch it in child */
+		handle->curlm = NULL;
+#endif
+
 		/* use fprintf instead of _alpm_log to send output through the parent */
 		/* don't chroot() to "/": this allows running with less caps when the
 		 * caller puts us in the right root */