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

Subscribers

People subscribed via source and target branches