Blame SOURCES/0020-curl-7.76.1-openldap-rebase.patch

372e18
From c2acc48854be9f8590e57a7b44b649fb8537bed4 Mon Sep 17 00:00:00 2001
372e18
From: Daniel Stenberg <daniel@haxx.se>
372e18
Date: Tue, 4 May 2021 16:14:13 +0200
372e18
Subject: [PATCH] openldap: replace ldap_ prefix on private functions
372e18
MIME-Version: 1.0
372e18
Content-Type: text/plain; charset=UTF-8
372e18
Content-Transfer-Encoding: 8bit
372e18
372e18
Since openldap itself uses that prefix and with OpenĹDAP 2.5.4 (at
372e18
least) there's a symbol collision because of that.
372e18
372e18
The private functions now use the 'oldap_' prefix where it previously
372e18
used 'ldap_'.
372e18
372e18
Reported-by: 3eka on github
372e18
Fixes #7004
372e18
Closes #7005
372e18
372e18
Upstream-commit: 8bdde6b14ce3b5fd71c772a578fcbd4b6fa6df19
372e18
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
372e18
---
372e18
 lib/openldap.c | 67 +++++++++++++++++++++++++-------------------------
372e18
 1 file changed, 34 insertions(+), 33 deletions(-)
372e18
372e18
diff --git a/lib/openldap.c b/lib/openldap.c
372e18
index b515554..5a32c74 100644
372e18
--- a/lib/openldap.c
372e18
+++ b/lib/openldap.c
372e18
@@ -76,16 +76,16 @@ extern int ldap_init_fd(ber_socket_t fd, int proto, const char *url,
372e18
                         LDAP **ld);
372e18
 #endif
372e18
 
372e18
-static CURLcode ldap_setup_connection(struct Curl_easy *data,
372e18
-                                      struct connectdata *conn);
372e18
-static CURLcode ldap_do(struct Curl_easy *data, bool *done);
372e18
-static CURLcode ldap_done(struct Curl_easy *data, CURLcode, bool);
372e18
-static CURLcode ldap_connect(struct Curl_easy *data, bool *done);
372e18
-static CURLcode ldap_connecting(struct Curl_easy *data, bool *done);
372e18
-static CURLcode ldap_disconnect(struct Curl_easy *data,
372e18
-                                struct connectdata *conn, bool dead);
372e18
+static CURLcode oldap_setup_connection(struct Curl_easy *data,
372e18
+                                       struct connectdata *conn);
372e18
+static CURLcode oldap_do(struct Curl_easy *data, bool *done);
372e18
+static CURLcode oldap_done(struct Curl_easy *data, CURLcode, bool);
372e18
+static CURLcode oldap_connect(struct Curl_easy *data, bool *done);
372e18
+static CURLcode oldap_connecting(struct Curl_easy *data, bool *done);
372e18
+static CURLcode oldap_disconnect(struct Curl_easy *data,
372e18
+                                 struct connectdata *conn, bool dead);
372e18
 
372e18
-static Curl_recv ldap_recv;
372e18
+static Curl_recv oldap_recv;
372e18
 
372e18
 /*
372e18
  * LDAP protocol handler.
372e18
@@ -93,18 +93,18 @@ static Curl_recv ldap_recv;
372e18
 
372e18
 const struct Curl_handler Curl_handler_ldap = {
372e18
   "LDAP",                               /* scheme */
372e18
-  ldap_setup_connection,                /* setup_connection */
372e18
-  ldap_do,                              /* do_it */
372e18
-  ldap_done,                            /* done */
372e18
+  oldap_setup_connection,               /* setup_connection */
372e18
+  oldap_do,                             /* do_it */
372e18
+  oldap_done,                           /* done */
372e18
   ZERO_NULL,                            /* do_more */
372e18
-  ldap_connect,                         /* connect_it */
372e18
-  ldap_connecting,                      /* connecting */
372e18
+  oldap_connect,                        /* connect_it */
372e18
+  oldap_connecting,                     /* connecting */
372e18
   ZERO_NULL,                            /* doing */
372e18
   ZERO_NULL,                            /* proto_getsock */
372e18
   ZERO_NULL,                            /* doing_getsock */
372e18
   ZERO_NULL,                            /* domore_getsock */
372e18
   ZERO_NULL,                            /* perform_getsock */
372e18
-  ldap_disconnect,                      /* disconnect */
372e18
+  oldap_disconnect,                     /* disconnect */
372e18
   ZERO_NULL,                            /* readwrite */
372e18
   ZERO_NULL,                            /* connection_check */
372e18
   ZERO_NULL,                            /* attach connection */
372e18
@@ -121,18 +121,18 @@ const struct Curl_handler Curl_handler_ldap = {
372e18
 
372e18
 const struct Curl_handler Curl_handler_ldaps = {
372e18
   "LDAPS",                              /* scheme */
372e18
-  ldap_setup_connection,                /* setup_connection */
372e18
-  ldap_do,                              /* do_it */
372e18
-  ldap_done,                            /* done */
372e18
+  oldap_setup_connection,               /* setup_connection */
372e18
+  oldap_do,                             /* do_it */
372e18
+  oldap_done,                           /* done */
372e18
   ZERO_NULL,                            /* do_more */
372e18
-  ldap_connect,                         /* connect_it */
372e18
-  ldap_connecting,                      /* connecting */
372e18
+  oldap_connect,                        /* connect_it */
372e18
+  oldap_connecting,                     /* connecting */
372e18
   ZERO_NULL,                            /* doing */
372e18
   ZERO_NULL,                            /* proto_getsock */
372e18
   ZERO_NULL,                            /* doing_getsock */
372e18
   ZERO_NULL,                            /* domore_getsock */
372e18
   ZERO_NULL,                            /* perform_getsock */
372e18
-  ldap_disconnect,                      /* disconnect */
372e18
+  oldap_disconnect,                     /* disconnect */
372e18
   ZERO_NULL,                            /* readwrite */
372e18
   ZERO_NULL,                            /* connection_check */
372e18
   ZERO_NULL,                            /* attach connection */
372e18
@@ -173,8 +173,8 @@ struct ldapreqinfo {
372e18
   int nument;
372e18
 };
372e18
 
372e18
-static CURLcode ldap_setup_connection(struct Curl_easy *data,
372e18
-                                      struct connectdata *conn)
372e18
+static CURLcode oldap_setup_connection(struct Curl_easy *data,
372e18
+                                       struct connectdata *conn)
372e18
 {
372e18
   struct ldapconninfo *li;
372e18
   LDAPURLDesc *lud;
372e18
@@ -209,7 +209,7 @@ static CURLcode ldap_setup_connection(struct Curl_easy *data,
372e18
 static Sockbuf_IO ldapsb_tls;
372e18
 #endif
372e18
 
372e18
-static CURLcode ldap_connect(struct Curl_easy *data, bool *done)
372e18
+static CURLcode oldap_connect(struct Curl_easy *data, bool *done)
372e18
 {
372e18
   struct connectdata *conn = data->conn;
372e18
   struct ldapconninfo *li = conn->proto.ldapc;
372e18
@@ -257,7 +257,7 @@ static CURLcode ldap_connect(struct Curl_easy *data, bool *done)
372e18
   return CURLE_OK;
372e18
 }
372e18
 
372e18
-static CURLcode ldap_connecting(struct Curl_easy *data, bool *done)
372e18
+static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
372e18
 {
372e18
   struct connectdata *conn = data->conn;
372e18
   struct ldapconninfo *li = conn->proto.ldapc;
372e18
@@ -356,14 +356,15 @@ static CURLcode ldap_connecting(struct Curl_easy *data, bool *done)
372e18
 
372e18
   if(info)
372e18
     ldap_memfree(info);
372e18
-  conn->recv[FIRSTSOCKET] = ldap_recv;
372e18
+  conn->recv[FIRSTSOCKET] = oldap_recv;
372e18
   *done = TRUE;
372e18
 
372e18
   return CURLE_OK;
372e18
 }
372e18
 
372e18
-static CURLcode ldap_disconnect(struct Curl_easy *data,
372e18
-                                struct connectdata *conn, bool dead_connection)
372e18
+static CURLcode oldap_disconnect(struct Curl_easy *data,
372e18
+                                 struct connectdata *conn,
372e18
+                                 bool dead_connection)
372e18
 {
372e18
   struct ldapconninfo *li = conn->proto.ldapc;
372e18
   (void) dead_connection;
372e18
@@ -384,7 +385,7 @@ static CURLcode ldap_disconnect(struct Curl_easy *data,
372e18
   return CURLE_OK;
372e18
 }
372e18
 
372e18
-static CURLcode ldap_do(struct Curl_easy *data, bool *done)
372e18
+static CURLcode oldap_do(struct Curl_easy *data, bool *done)
372e18
 {
372e18
   struct connectdata *conn = data->conn;
372e18
   struct ldapconninfo *li = conn->proto.ldapc;
372e18
@@ -429,8 +430,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
372e18
   return CURLE_OK;
372e18
 }
372e18
 
372e18
-static CURLcode ldap_done(struct Curl_easy *data, CURLcode res,
372e18
-                          bool premature)
372e18
+static CURLcode oldap_done(struct Curl_easy *data, CURLcode res,
372e18
+                           bool premature)
372e18
 {
372e18
   struct connectdata *conn = data->conn;
372e18
   struct ldapreqinfo *lr = data->req.p.ldap;
372e18
@@ -452,8 +453,8 @@ static CURLcode ldap_done(struct Curl_easy *data, CURLcode res,
372e18
   return CURLE_OK;
372e18
 }
372e18
 
372e18
-static ssize_t ldap_recv(struct Curl_easy *data, int sockindex, char *buf,
372e18
-                         size_t len, CURLcode *err)
372e18
+static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
372e18
+                          size_t len, CURLcode *err)
372e18
 {
372e18
   struct connectdata *conn = data->conn;
372e18
   struct ldapconninfo *li = conn->proto.ldapc;
372e18
-- 
372e18
2.35.3
372e18