Merge ~sergiodj/ubuntu/+source/curl:fix-ftbfs-openldap-2.5 into ubuntu/+source/curl:ubuntu/devel

Proposed by Sergio Durigan Junior
Status: Merged
Approved by: Sergio Durigan Junior
Approved revision: d8ec2f4e3f4a11c709dcceb7dd45ee68af8482f5
Merged at revision: d8ec2f4e3f4a11c709dcceb7dd45ee68af8482f5
Proposed branch: ~sergiodj/ubuntu/+source/curl:fix-ftbfs-openldap-2.5
Merge into: ubuntu/+source/curl:ubuntu/devel
Diff against target: 208 lines (+183/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/16_openldap-replace-ldap_-prefix-on-private-functions.patch (+175/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Core Reviewers Pending
Review via email: mp+403021@code.launchpad.net

Description of the change

This is the backport of an upstream patch to properly adjust curl so that it can build with OpenLDAP 2.5. We still don't have this openldap version in the archive, but I'm working on getting it ready and fixing FTBFSes is part of this task.

The patch is pretty straightforward and its purpose is to rename an internal curl function called "ldap_connect" to something else, because OpenLDAP 2.5 will export this function name. It ends up renaming a bunch of other internal functions whose names start with "ldap_".

There's a PPA with the proposed change here:

https://launchpad.net/~sergiodj/+archive/ubuntu/curl-ftbfs-openldap/+packages

I have submitted this patch to the Debian curl package here:

https://salsa.debian.org/debian/curl/-/merge_requests/11

but it seems like it's going to be a while until they pick this up, so I decided to go ahead and backport the patch to Ubuntu first (given that we will have the new OpenLDAP here first).

There are no autopkgtests for this package.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Builds all passed, though there's a couple still publishing.

LGTM, +1

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the quick review, Bryce.

Pushed & uploaded:

$ git push pkg upload/7.74.0-1.2ubuntu2
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 2.84 KiB | 223.00 KiB/s, done.
Total 11 (delta 7), reused 1 (delta 0)
To ssh://git.launchpad.net/ubuntu/+source/curl
 * [new tag] upload/7.74.0-1.2ubuntu2 -> upload/7.74.0-1.2ubuntu2

$ dput curl_7.74.0-1.2ubuntu2_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/curl/curl_7.74.0-1.2ubuntu2_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/curl/curl_7.74.0-1.2ubuntu2.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading curl_7.74.0-1.2ubuntu2.dsc: done.
  Uploading curl_7.74.0-1.2ubuntu2.debian.tar.xz: done.
  Uploading curl_7.74.0-1.2ubuntu2_source.buildinfo: done.
  Uploading curl_7.74.0-1.2ubuntu2_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index f3b094f..3032a73 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+curl (7.74.0-1.2ubuntu2) impish; urgency=medium
7+
8+ * d/p/16_openldap-replace-ldap_-prefix-on-private-functions.patch:
9+ Fix FTBFS with OpenLDAP 2.5.
10+
11+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Wed, 19 May 2021 19:13:37 -0400
12+
13 curl (7.74.0-1.2ubuntu1) impish; urgency=medium
14
15 * Merge from Debian unstable. Remaining changes:
16diff --git a/debian/patches/16_openldap-replace-ldap_-prefix-on-private-functions.patch b/debian/patches/16_openldap-replace-ldap_-prefix-on-private-functions.patch
17new file mode 100644
18index 0000000..735b668
19--- /dev/null
20+++ b/debian/patches/16_openldap-replace-ldap_-prefix-on-private-functions.patch
21@@ -0,0 +1,175 @@
22+From: Daniel Stenberg <daniel@haxx.se>
23+Date: Tue, 4 May 2021 16:14:13 +0200
24+Subject: openldap: replace ldap_ prefix on private functions
25+MIME-Version: 1.0
26+Content-Type: text/plain; charset="utf-8"
27+Content-Transfer-Encoding: 8bit
28+
29+Since openldap itself uses that prefix and with OpenĹDAP 2.5.4 (at
30+least) there's a symbol collision because of that.
31+
32+The private functions now use the 'oldap_' prefix where it previously
33+used 'ldap_'.
34+
35+Reported-by: 3eka on github
36+Fixes #7004
37+Closes #7005
38+
39+Origin: backport, https://github.com/curl/curl/commit/8bdde6b14ce3b5fd71c772a578fcbd4b6fa6df19
40+Bug: https://github.com/curl/curl/issues/7004
41+Reviewed-By: Sergio Durigan Junior <sergiodj@debian.org>
42+Last-Updated: 2021-05-13
43+---
44+ lib/openldap.c | 58 +++++++++++++++++++++++++++++-----------------------------
45+ 1 file changed, 29 insertions(+), 29 deletions(-)
46+
47+diff --git a/lib/openldap.c b/lib/openldap.c
48+index 24892ff..32efe0e 100644
49+--- a/lib/openldap.c
50++++ b/lib/openldap.c
51+@@ -76,14 +76,14 @@ extern int ldap_init_fd(ber_socket_t fd, int proto, const char *url,
52+ LDAP **ld);
53+ #endif
54+
55+-static CURLcode ldap_setup_connection(struct connectdata *conn);
56+-static CURLcode ldap_do(struct connectdata *conn, bool *done);
57+-static CURLcode ldap_done(struct connectdata *conn, CURLcode, bool);
58+-static CURLcode ldap_connect(struct connectdata *conn, bool *done);
59+-static CURLcode ldap_connecting(struct connectdata *conn, bool *done);
60+-static CURLcode ldap_disconnect(struct connectdata *conn, bool dead);
61++static CURLcode oldap_setup_connection(struct connectdata *conn);
62++static CURLcode oldap_do(struct connectdata *conn, bool *done);
63++static CURLcode oldap_done(struct connectdata *conn, CURLcode, bool);
64++static CURLcode oldap_connect(struct connectdata *conn, bool *done);
65++static CURLcode oldap_connecting(struct connectdata *conn, bool *done);
66++static CURLcode oldap_disconnect(struct connectdata *conn, bool dead);
67+
68+-static Curl_recv ldap_recv;
69++static Curl_recv oldap_recv;
70+
71+ /*
72+ * LDAP protocol handler.
73+@@ -91,18 +91,18 @@ static Curl_recv ldap_recv;
74+
75+ const struct Curl_handler Curl_handler_ldap = {
76+ "LDAP", /* scheme */
77+- ldap_setup_connection, /* setup_connection */
78+- ldap_do, /* do_it */
79+- ldap_done, /* done */
80++ oldap_setup_connection, /* setup_connection */
81++ oldap_do, /* do_it */
82++ oldap_done, /* done */
83+ ZERO_NULL, /* do_more */
84+- ldap_connect, /* connect_it */
85+- ldap_connecting, /* connecting */
86++ oldap_connect, /* connect_it */
87++ oldap_connecting, /* connecting */
88+ ZERO_NULL, /* doing */
89+ ZERO_NULL, /* proto_getsock */
90+ ZERO_NULL, /* doing_getsock */
91+ ZERO_NULL, /* domore_getsock */
92+ ZERO_NULL, /* perform_getsock */
93+- ldap_disconnect, /* disconnect */
94++ oldap_disconnect, /* disconnect */
95+ ZERO_NULL, /* readwrite */
96+ ZERO_NULL, /* connection_check */
97+ PORT_LDAP, /* defport */
98+@@ -118,18 +118,18 @@ const struct Curl_handler Curl_handler_ldap = {
99+
100+ const struct Curl_handler Curl_handler_ldaps = {
101+ "LDAPS", /* scheme */
102+- ldap_setup_connection, /* setup_connection */
103+- ldap_do, /* do_it */
104+- ldap_done, /* done */
105++ oldap_setup_connection, /* setup_connection */
106++ oldap_do, /* do_it */
107++ oldap_done, /* done */
108+ ZERO_NULL, /* do_more */
109+- ldap_connect, /* connect_it */
110+- ldap_connecting, /* connecting */
111++ oldap_connect, /* connect_it */
112++ oldap_connecting, /* connecting */
113+ ZERO_NULL, /* doing */
114+ ZERO_NULL, /* proto_getsock */
115+ ZERO_NULL, /* doing_getsock */
116+ ZERO_NULL, /* domore_getsock */
117+ ZERO_NULL, /* perform_getsock */
118+- ldap_disconnect, /* disconnect */
119++ oldap_disconnect, /* disconnect */
120+ ZERO_NULL, /* readwrite */
121+ ZERO_NULL, /* connection_check */
122+ PORT_LDAPS, /* defport */
123+@@ -169,7 +169,7 @@ struct ldapreqinfo {
124+ int nument;
125+ };
126+
127+-static CURLcode ldap_setup_connection(struct connectdata *conn)
128++static CURLcode oldap_setup_connection(struct connectdata *conn)
129+ {
130+ struct ldapconninfo *li;
131+ LDAPURLDesc *lud;
132+@@ -205,7 +205,7 @@ static CURLcode ldap_setup_connection(struct connectdata *conn)
133+ static Sockbuf_IO ldapsb_tls;
134+ #endif
135+
136+-static CURLcode ldap_connect(struct connectdata *conn, bool *done)
137++static CURLcode oldap_connect(struct connectdata *conn, bool *done)
138+ {
139+ struct ldapconninfo *li = conn->proto.ldapc;
140+ struct Curl_easy *data = conn->data;
141+@@ -252,7 +252,7 @@ static CURLcode ldap_connect(struct connectdata *conn, bool *done)
142+ return CURLE_OK;
143+ }
144+
145+-static CURLcode ldap_connecting(struct connectdata *conn, bool *done)
146++static CURLcode oldap_connecting(struct connectdata *conn, bool *done)
147+ {
148+ struct ldapconninfo *li = conn->proto.ldapc;
149+ struct Curl_easy *data = conn->data;
150+@@ -351,13 +351,13 @@ static CURLcode ldap_connecting(struct connectdata *conn, bool *done)
151+
152+ if(info)
153+ ldap_memfree(info);
154+- conn->recv[FIRSTSOCKET] = ldap_recv;
155++ conn->recv[FIRSTSOCKET] = oldap_recv;
156+ *done = TRUE;
157+
158+ return CURLE_OK;
159+ }
160+
161+-static CURLcode ldap_disconnect(struct connectdata *conn, bool dead_connection)
162++static CURLcode oldap_disconnect(struct connectdata *conn, bool dead_connection)
163+ {
164+ struct ldapconninfo *li = conn->proto.ldapc;
165+ (void) dead_connection;
166+@@ -373,7 +373,7 @@ static CURLcode ldap_disconnect(struct connectdata *conn, bool dead_connection)
167+ return CURLE_OK;
168+ }
169+
170+-static CURLcode ldap_do(struct connectdata *conn, bool *done)
171++static CURLcode oldap_do(struct connectdata *conn, bool *done)
172+ {
173+ struct ldapconninfo *li = conn->proto.ldapc;
174+ struct ldapreqinfo *lr;
175+@@ -418,8 +418,8 @@ static CURLcode ldap_do(struct connectdata *conn, bool *done)
176+ return CURLE_OK;
177+ }
178+
179+-static CURLcode ldap_done(struct connectdata *conn, CURLcode res,
180+- bool premature)
181++static CURLcode oldap_done(struct connectdata *conn, CURLcode res,
182++ bool premature)
183+ {
184+ struct ldapreqinfo *lr = conn->data->req.p.ldap;
185+
186+@@ -440,8 +440,8 @@ static CURLcode ldap_done(struct connectdata *conn, CURLcode res,
187+ return CURLE_OK;
188+ }
189+
190+-static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
191+- size_t len, CURLcode *err)
192++static ssize_t oldap_recv(struct connectdata *conn, int sockindex, char *buf,
193++ size_t len, CURLcode *err)
194+ {
195+ struct ldapconninfo *li = conn->proto.ldapc;
196+ struct Curl_easy *data = conn->data;
197diff --git a/debian/patches/series b/debian/patches/series
198index 48fa80b..2b4a41c 100644
199--- a/debian/patches/series
200+++ b/debian/patches/series
201@@ -7,6 +7,7 @@
202 13_fix-man-formatting.patch
203 14_transfer-strip-credentials-from-the-auto-referer-hea.patch
204 15_vtls-add-isproxy-argument-to-Curl_ssl_get-addsession.patch
205+16_openldap-replace-ldap_-prefix-on-private-functions.patch
206
207 # do not add patches below
208 90_gnutls.patch

Subscribers

People subscribed via source and target branches