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

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