X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-integ%2Frecipes-support%2Fopenldap%2Ffiles%2F0012-openldap-ldapi-sasl.patch;fp=meta-starlingx%2Fmeta-stx-integ%2Frecipes-support%2Fopenldap%2Ffiles%2F0012-openldap-ldapi-sasl.patch;h=0000000000000000000000000000000000000000;hb=6fc6934434f70595536a387ece31bc30141cafb5;hp=db753aa792fc4ee164b073316c665b741aeeb55b;hpb=eb1e26510491ba49de693ab3b0498edcb06be6c5;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-integ/recipes-support/openldap/files/0012-openldap-ldapi-sasl.patch b/meta-starlingx/meta-stx-integ/recipes-support/openldap/files/0012-openldap-ldapi-sasl.patch deleted file mode 100644 index db753aa..0000000 --- a/meta-starlingx/meta-stx-integ/recipes-support/openldap/files/0012-openldap-ldapi-sasl.patch +++ /dev/null @@ -1,55 +0,0 @@ -From b2623b57b79becf707ff1800bfb5153af3f0d1fc Mon Sep 17 00:00:00 2001 -From: babak sarashki -Date: Wed, 4 Dec 2019 07:58:45 -0800 -Subject: [PATCH 12/12] openldap ldapi sasl - -From stx 1901: openldap-ldapi-sasl.patch ---- - libraries/libldap/cyrus.c | 19 ++++++++++++++++--- - 1 file changed, 16 insertions(+), 3 deletions(-) - -diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c -index 8a496f990..06a9fdf41 100644 ---- a/libraries/libldap/cyrus.c -+++ b/libraries/libldap/cyrus.c -@@ -385,6 +385,8 @@ ldap_int_sasl_bind( - struct berval ccred = BER_BVNULL; - int saslrc, rc; - unsigned credlen; -+ char my_hostname[HOST_NAME_MAX + 1]; -+ int free_saslhost = 0; - - Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n", - mechs ? mechs : "", 0, 0 ); -@@ -445,14 +447,25 @@ ldap_int_sasl_bind( - - /* If we don't need to canonicalize just use the host - * from the LDAP URI. -+ * Always use the result of gethostname() for LDAPI. - */ -- if ( nocanon ) -+ if (ld->ld_defconn->lconn_server->lud_scheme != NULL && -+ strcmp("ldapi", ld->ld_defconn->lconn_server->lud_scheme) == 0) { -+ rc = gethostname(my_hostname, HOST_NAME_MAX + 1); -+ if (rc == 0) { -+ saslhost = my_hostname; -+ } else { -+ saslhost = "localhost"; -+ } -+ } else if ( nocanon ) - saslhost = ld->ld_defconn->lconn_server->lud_host; -- else -+ else { - saslhost = ldap_host_connected_to( ld->ld_defconn->lconn_sb, - "localhost" ); -+ free_saslhost = 1; -+ } - rc = ldap_int_sasl_open( ld, ld->ld_defconn, saslhost ); -- if ( !nocanon ) -+ if ( free_saslhost ) - LDAP_FREE( saslhost ); - } - --- -2.17.1 -