Ticket #15026: curl-7.76.1-function_naming-1.patch

File curl-7.76.1-function_naming-1.patch, 7.6 KB (added by thomas, 3 years ago)

upstream patch

  • lib/openldap.c

    From 8bdde6b14ce3b5fd71c772a578fcbd4b6fa6df19 Mon Sep 17 00:00:00 2001
    From: Daniel Stenberg <daniel@haxx.se>
    Date: Tue, 4 May 2021 16:14:13 +0200
    Subject: [PATCH] openldap: replace ldap_ prefix on private functions
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    Since openldap itself uses that prefix and with OpenĹDAP 2.5.4 (at
    least) there's a symbol collision because of that.
    
    The private functions now use the 'oldap_' prefix where it previously
    used 'ldap_'.
    
    Reported-by: 3eka on github
    Fixes #7004
    Closes #7005
    ---
     lib/openldap.c | 67 +++++++++++++++++++++++++-------------------------
     1 file changed, 34 insertions(+), 33 deletions(-)
    
    diff --git a/lib/openldap.c b/lib/openldap.c
    index a5560fc9b294..20d4f51a64c3 100644
    a b extern int ldap_init_fd(ber_socket_t fd, int proto, const char *url,  
    7676                        LDAP **ld);
    7777#endif
    7878
    79 static CURLcode ldap_setup_connection(struct Curl_easy *data,
    80                                       struct connectdata *conn);
    81 static CURLcode ldap_do(struct Curl_easy *data, bool *done);
    82 static CURLcode ldap_done(struct Curl_easy *data, CURLcode, bool);
    83 static CURLcode ldap_connect(struct Curl_easy *data, bool *done);
    84 static CURLcode ldap_connecting(struct Curl_easy *data, bool *done);
    85 static CURLcode ldap_disconnect(struct Curl_easy *data,
    86                                 struct connectdata *conn, bool dead);
     79static CURLcode oldap_setup_connection(struct Curl_easy *data,
     80                                       struct connectdata *conn);
     81static CURLcode oldap_do(struct Curl_easy *data, bool *done);
     82static CURLcode oldap_done(struct Curl_easy *data, CURLcode, bool);
     83static CURLcode oldap_connect(struct Curl_easy *data, bool *done);
     84static CURLcode oldap_connecting(struct Curl_easy *data, bool *done);
     85static CURLcode oldap_disconnect(struct Curl_easy *data,
     86                                 struct connectdata *conn, bool dead);
    8787
    88 static Curl_recv ldap_recv;
     88static Curl_recv oldap_recv;
    8989
    9090/*
    9191 * LDAP protocol handler.
    static Curl_recv ldap_recv;  
    9393
    9494const struct Curl_handler Curl_handler_ldap = {
    9595  "LDAP",                               /* scheme */
    96   ldap_setup_connection,                /* setup_connection */
    97   ldap_do,                              /* do_it */
    98   ldap_done,                            /* done */
     96  oldap_setup_connection,               /* setup_connection */
     97  oldap_do,                             /* do_it */
     98  oldap_done,                           /* done */
    9999  ZERO_NULL,                            /* do_more */
    100   ldap_connect,                         /* connect_it */
    101   ldap_connecting,                      /* connecting */
     100  oldap_connect,                        /* connect_it */
     101  oldap_connecting,                     /* connecting */
    102102  ZERO_NULL,                            /* doing */
    103103  ZERO_NULL,                            /* proto_getsock */
    104104  ZERO_NULL,                            /* doing_getsock */
    105105  ZERO_NULL,                            /* domore_getsock */
    106106  ZERO_NULL,                            /* perform_getsock */
    107   ldap_disconnect,                      /* disconnect */
     107  oldap_disconnect,                     /* disconnect */
    108108  ZERO_NULL,                            /* readwrite */
    109109  ZERO_NULL,                            /* connection_check */
    110110  PORT_LDAP,                            /* defport */
    const struct Curl_handler Curl_handler_ldap = {  
    120120
    121121const struct Curl_handler Curl_handler_ldaps = {
    122122  "LDAPS",                              /* scheme */
    123   ldap_setup_connection,                /* setup_connection */
    124   ldap_do,                              /* do_it */
    125   ldap_done,                            /* done */
     123  oldap_setup_connection,               /* setup_connection */
     124  oldap_do,                             /* do_it */
     125  oldap_done,                           /* done */
    126126  ZERO_NULL,                            /* do_more */
    127   ldap_connect,                         /* connect_it */
    128   ldap_connecting,                      /* connecting */
     127  oldap_connect,                        /* connect_it */
     128  oldap_connecting,                     /* connecting */
    129129  ZERO_NULL,                            /* doing */
    130130  ZERO_NULL,                            /* proto_getsock */
    131131  ZERO_NULL,                            /* doing_getsock */
    132132  ZERO_NULL,                            /* domore_getsock */
    133133  ZERO_NULL,                            /* perform_getsock */
    134   ldap_disconnect,                      /* disconnect */
     134  oldap_disconnect,                     /* disconnect */
    135135  ZERO_NULL,                            /* readwrite */
    136136  ZERO_NULL,                            /* connection_check */
    137137  PORT_LDAPS,                           /* defport */
    struct ldapreqinfo {  
    171171  int nument;
    172172};
    173173
    174 static CURLcode ldap_setup_connection(struct Curl_easy *data,
    175                                       struct connectdata *conn)
     174static CURLcode oldap_setup_connection(struct Curl_easy *data,
     175                                       struct connectdata *conn)
    176176{
    177177  struct ldapconninfo *li;
    178178  LDAPURLDesc *lud;
    static CURLcode ldap_setup_connection(struct Curl_easy *data,  
    207207static Sockbuf_IO ldapsb_tls;
    208208#endif
    209209
    210 static CURLcode ldap_connect(struct Curl_easy *data, bool *done)
     210static CURLcode oldap_connect(struct Curl_easy *data, bool *done)
    211211{
    212212  struct connectdata *conn = data->conn;
    213213  struct ldapconninfo *li = conn->proto.ldapc;
    static CURLcode ldap_connect(struct Curl_easy *data, bool *done)  
    255255  return CURLE_OK;
    256256}
    257257
    258 static CURLcode ldap_connecting(struct Curl_easy *data, bool *done)
     258static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
    259259{
    260260  struct connectdata *conn = data->conn;
    261261  struct ldapconninfo *li = conn->proto.ldapc;
    static CURLcode ldap_connecting(struct Curl_easy *data, bool *done)  
    354354
    355355  if(info)
    356356    ldap_memfree(info);
    357   conn->recv[FIRSTSOCKET] = ldap_recv;
     357  conn->recv[FIRSTSOCKET] = oldap_recv;
    358358  *done = TRUE;
    359359
    360360  return CURLE_OK;
    361361}
    362362
    363 static CURLcode ldap_disconnect(struct Curl_easy *data,
    364                                 struct connectdata *conn, bool dead_connection)
     363static CURLcode oldap_disconnect(struct Curl_easy *data,
     364                                 struct connectdata *conn,
     365                                 bool dead_connection)
    365366{
    366367  struct ldapconninfo *li = conn->proto.ldapc;
    367368  (void) dead_connection;
    static CURLcode ldap_disconnect(struct Curl_easy *data,  
    384385  return CURLE_OK;
    385386}
    386387
    387 static CURLcode ldap_do(struct Curl_easy *data, bool *done)
     388static CURLcode oldap_do(struct Curl_easy *data, bool *done)
    388389{
    389390  struct connectdata *conn = data->conn;
    390391  struct ldapconninfo *li = conn->proto.ldapc;
    static CURLcode ldap_do(struct Curl_easy *data, bool *done)  
    429430  return CURLE_OK;
    430431}
    431432
    432 static CURLcode ldap_done(struct Curl_easy *data, CURLcode res,
    433                           bool premature)
     433static CURLcode oldap_done(struct Curl_easy *data, CURLcode res,
     434                           bool premature)
    434435{
    435436  struct connectdata *conn = data->conn;
    436437  struct ldapreqinfo *lr = data->req.p.ldap;
    static CURLcode ldap_done(struct Curl_easy *data, CURLcode res,  
    452453  return CURLE_OK;
    453454}
    454455
    455 static ssize_t ldap_recv(struct Curl_easy *data, int sockindex, char *buf,
    456                          size_t len, CURLcode *err)
     456static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
     457                          size_t len, CURLcode *err)
    457458{
    458459  struct connectdata *conn = data->conn;
    459460  struct ldapconninfo *li = conn->proto.ldapc;