Issue 8671 - Declare ldap_init_fd() in ldap.h to help external consumers
Summary: Declare ldap_init_fd() in ldap.h to help external consumers
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
: 8833 8834 8982 (view as issue list)
Depends on:
Blocks:
 
Reported: 2017-06-07 10:38 UTC by abokovoy@redhat.com
Modified: 2020-03-23 21:04 UTC (History)
2 users (show)

See Also:


Attachments
abokovoy-master-ldap_init_fd-move-ldap_init_fd-definition-to-ldap.h.patch (2.26 KB, text/plain)
2017-10-19 06:20 UTC, abokovoy@redhat.com
Details
abokovoy-v2.4-ldap_init_fd-move-ldap_init_fd-definition-to-ldap.h.patch (2.25 KB, text/plain)
2017-10-19 06:20 UTC, abokovoy@redhat.com
Details
abokovoy-ldap_init_fd-move-ldap_init_fd-definition-to-ldap.h.patch (2.25 KB, text/plain)
2017-06-07 10:44 UTC, abokovoy@redhat.com
Details

Note You need to log in before you can comment on or make changes to this issue.
Description abokovoy@redhat.com 2017-06-07 10:38:11 UTC
Full_Name: Alexander Bokovoy
Version: 
OS: 
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (88.115.170.217)


As discussed on the openldap-devel@, Samba team would like to use ldap_init_fd()
to allow Samba handle actual sockets. To do so we would like to see
ldap_init_fd() declared in ldap.h instead of ldap_pvt.h. The latter is not
shipped by most distributions at all.

Proposed patch moves ldap_init_fd() declaration to ldap.h and changes references
to it in the corresponding manual pages. You can do what you want with the
proposed patch since it does not really contain any code I have written.
Comment 1 abokovoy@redhat.com 2017-06-07 10:44:03 UTC
Patch attached.

-- 
/ Alexander Bokovoy
Comment 2 Quanah Gibson-Mount 2017-09-11 16:44:47 UTC
changed notes
Comment 3 Quanah Gibson-Mount 2017-09-12 17:49:41 UTC
Hi Alexander,

Your submission appears to be missing an IPR statement as noted at 
<https://www.openldap.org/devel/contributing.html#notice>.  This is 
required for your submission to be evaluated.  Please add an IPR at your 
earliest convenience.

Thanks!

--Quanah

--On Wednesday, June 07, 2017 11:44 AM +0000 abokovoy@redhat.com wrote:

>
> --ce5n3c4hsgyizewc
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Disposition: inline
>
> Patch attached.
>
> --
> / Alexander Bokovoy
>
> --ce5n3c4hsgyizewc
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment;
> filename="abokovoy-ldap_init_fd-move-ldap_init_fd-definition-to-ldap.h.pa
> tch" Content-Transfer-Encoding: quoted-printable
>
> =46rom 2c1f3afd8098b2a345a900effa1a2e5c3f9e3b08 Mon Sep 17 00:00:00 2001
> =46rom: Alexander Bokovoy <abokovoy@redhat.com>
> Date: Mon, 5 Jun 2017 14:43:58 +0300
> Subject: [PATCH] ldap_init_fd: move ldap_init_fd() definition to ldap.h
>
> While OpenLDAP team position is that all code in OpenLDAP source
> distribution can be used by users, most distributions do not ship
> ldap_pvt.h as part of openldap-devel (sub)package.
>
> Move ldap_init_fd() to ldap.h to facilitate external users who have a
> need to integrate OpenLDAP with their own event loop processing.
> ---
>  doc/man/man3/ldap_open.3 | 5 +----
>  include/ldap.h           | 8 ++++++++
>  include/ldap_pvt.h       | 2 --
>  3 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/doc/man/man3/ldap_open.3 b/doc/man/man3/ldap_open.3
> index 1d5e2b5..4f980f2 100644
> --- a/doc/man/man3/ldap_open.3
> +++ b/doc/man/man3/ldap_open.3
> @@ -3,7 +3,7 @@
>  .\" Copyright 1998-2017 The OpenLDAP Foundation All Rights Reserved.
>  .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
>  .SH NAME
> -ldap_init, ldap_initialize, ldap_open \- Initialize the LDAP library and
> o= pen a connection to an LDAP server
> +ldap_init, ldap_initialize, ldap_open, ldap_init_fd \- Initialize the
> LDAP=  library and open a connection to an LDAP server
>  .SH LIBRARY
>  OpenLDAP LDAP (libldap, \-lldap)
>  .SH SYNOPSIS
> @@ -45,9 +45,6 @@ LDAPURLDesc **url;
>  void *params;
>  .LP
>  .ft B
> -#include <ldap_pvt.h>
> -.LP
> -.ft B
>  int ldap_init_fd(fd, proto, uri, ldp)
>  .ft
>  ber_socket_t fd;
> diff --git a/include/ldap.h b/include/ldap.h
> index 588e906..dd0c118 100644
> --- a/include/ldap.h
> +++ b/include/ldap.h
> @@ -1548,6 +1548,14 @@ LDAP_F( LDAP * )
>  ldap_dup LDAP_P((
>  	LDAP *old ));
> =20
> +/* open */
> +LDAP_F (int)
> +ldap_init_fd LDAP_P((
> +	ber_socket_t fd,
> +	int proto,
> +	LDAP_CONST char *url,
> +	LDAP **ldp ));
> +
>  /*
>   * in tls.c
>   */
> diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h
> index f1d93ac..49f674c 100644
> --- a/include/ldap_pvt.h
> +++ b/include/ldap_pvt.h
> @@ -344,8 +344,6 @@ ldap_get_message_ber LDAP_P((
>  /* open */
>  LDAP_F (int) ldap_open_internal_connection LDAP_P((
>  	struct ldap **ldp, ber_socket_t *fdp ));
> -LDAP_F (int) ldap_init_fd LDAP_P((
> -	ber_socket_t fd, int proto, LDAP_CONST char *url, struct ldap **ldp ));
> =20
>  /* sasl.c */
>  LDAP_F (int) ldap_pvt_sasl_generic_install LDAP_P(( Sockbuf *sb,
> --=20
> 2.9.3
>
>
> --ce5n3c4hsgyizewc--
>
>
>



--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


Comment 4 Quanah Gibson-Mount 2017-09-12 17:49:51 UTC
changed notes
Comment 5 abokovoy@redhat.com 2017-10-19 06:20:00 UTC
Hi Quanah,

On ti, 12 syys 2017, Quanah Gibson-Mount wrote:
>Hi Alexander,
>
>Your submission appears to be missing an IPR statement as noted at 
><https://www.openldap.org/devel/contributing.html#notice>.  This is 
>required for your submission to be evaluated.  Please add an IPR at 
>your earliest convenience.
Attached is a re-based patch set since there were changes in git master
in last month or so that affected the same area.

There are two patches: one for git master, one for 2.4 branch. Since
there is no functional change in the code, I'd like to see the 2.4
version in an upcoming release as that would greatly help Samba.

I'm also including an IPR notice below:

Red Hat, Inc. hereby place the following modifications to OpenLDAP
Software (and only these modifications) into the public domain.
Hence, these modifications may be freely used and/or redistributed
for any purpose with or without attribution and/or other notice.

Regards,
-- 
/ Alexander Bokovoy
Comment 6 Quanah Gibson-Mount 2017-10-19 15:39:13 UTC
--On Thursday, October 19, 2017 10:20 AM +0300 Alexander Bokovoy 
<abokovoy@redhat.com> wrote:

> Hi Quanah,
>
> On ti, 12 syys 2017, Quanah Gibson-Mount wrote:
>> Hi Alexander,
>>
>> Your submission appears to be missing an IPR statement as noted at
>> <https://www.openldap.org/devel/contributing.html#notice>.  This is
>> required for your submission to be evaluated.  Please add an IPR at
>> your earliest convenience.
> Attached is a re-based patch set since there were changes in git master
> in last month or so that affected the same area.
>
> There are two patches: one for git master, one for 2.4 branch. Since
> there is no functional change in the code, I'd like to see the 2.4
> version in an upcoming release as that would greatly help Samba.
>
> I'm also including an IPR notice below:
>
> Red Hat, Inc. hereby place the following modifications to OpenLDAP
> Software (and only these modifications) into the public domain.
> Hence, these modifications may be freely used and/or redistributed
> for any purpose with or without attribution and/or other notice.

Thanks very much!  I'll get this into my scratch repo for review.

--Quanah

--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


Comment 7 Quanah Gibson-Mount 2017-10-19 17:38:21 UTC
changed notes
Comment 8 Ondřej Kuzník 2019-06-14 11:19:21 UTC
On Thu, Oct 19, 2017 at 03:39:24PM +0000, quanah@symas.com wrote:
> --On Thursday, October 19, 2017 10:20 AM +0300 Alexander Bokovoy 
> <abokovoy@redhat.com> wrote:
>> Hi Quanah,
>>
>> On ti, 12 syys 2017, Quanah Gibson-Mount wrote:
>>> Hi Alexander,
>>>
>>> Your submission appears to be missing an IPR statement as noted at
>>> <https://www.openldap.org/devel/contributing.html#notice>.  This is
>>> required for your submission to be evaluated.  Please add an IPR at
>>> your earliest convenience.
>> Attached is a re-based patch set since there were changes in git master
>> in last month or so that affected the same area.
>>
>> There are two patches: one for git master, one for 2.4 branch. Since
>> there is no functional change in the code, I'd like to see the 2.4
>> version in an upcoming release as that would greatly help Samba.
>>
>> I'm also including an IPR notice below:
>>
>> Red Hat, Inc. hereby place the following modifications to OpenLDAP
>> Software (and only these modifications) into the public domain.
>> Hence, these modifications may be freely used and/or redistributed
>> for any purpose with or without attribution and/or other notice.
> 
> Thanks very much!  I'll get this into my scratch repo for review.

Hi Alexander,
as of commit 6a5e30674b63b17587738ba9a3d1ea3633c33fb1, OpenLDAP master
now ships and installs a new header <openldap.h> that should expose
ldap_init_fd(). Could you check this will work for Samba before we apply
this change in 2.4?

Thanks,

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP

Comment 9 abokovoy@redhat.com 2019-06-14 11:50:07 UTC
On pe, 14 kesä 2019, Ondřej Kuzník wrote:
>On Thu, Oct 19, 2017 at 03:39:24PM +0000, quanah@symas.com wrote:
>> --On Thursday, October 19, 2017 10:20 AM +0300 Alexander Bokovoy
>> <abokovoy@redhat.com> wrote:
>>> Hi Quanah,
>>>
>>> On ti, 12 syys 2017, Quanah Gibson-Mount wrote:
>>>> Hi Alexander,
>>>>
>>>> Your submission appears to be missing an IPR statement as noted at
>>>> <https://www.openldap.org/devel/contributing.html#notice>.  This is
>>>> required for your submission to be evaluated.  Please add an IPR at
>>>> your earliest convenience.
>>> Attached is a re-based patch set since there were changes in git master
>>> in last month or so that affected the same area.
>>>
>>> There are two patches: one for git master, one for 2.4 branch. Since
>>> there is no functional change in the code, I'd like to see the 2.4
>>> version in an upcoming release as that would greatly help Samba.
>>>
>>> I'm also including an IPR notice below:
>>>
>>> Red Hat, Inc. hereby place the following modifications to OpenLDAP
>>> Software (and only these modifications) into the public domain.
>>> Hence, these modifications may be freely used and/or redistributed
>>> for any purpose with or without attribution and/or other notice.
>>
>> Thanks very much!  I'll get this into my scratch repo for review.
>
>Hi Alexander,
>as of commit 6a5e30674b63b17587738ba9a3d1ea3633c33fb1, OpenLDAP master
>now ships and installs a new header <openldap.h> that should expose
>ldap_init_fd(). Could you check this will work for Samba before we apply
>this change in 2.4?
Thanks. I've compiled openldap git master and installed it, I can see
$prefix/include/openldap.h with ldap_init_fd() and man pages have proper
references to openldap.h.

Looks good to me. Once 2.4 becomes available, we can add support of this
to Samba.

-- 
/ Alexander Bokovoy
Sr. Principal Software Engineer
Security / Identity Management Engineering
Red Hat Limited, Finland

Comment 10 Quanah Gibson-Mount 2019-06-14 14:47:03 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Enhancements
Comment 11 Quanah Gibson-Mount 2019-06-14 16:43:35 UTC
changed notes
changed state Test to Release
Comment 12 Ondřej Kuzník 2019-06-17 11:30:14 UTC
On Fri, Jun 14, 2019 at 11:50:20AM +0000, abokovoy@redhat.com wrote:
> On pe, 14 kesä 2019, Ondřej Kuzník wrote:
>> Hi Alexander,
>> as of commit 6a5e30674b63b17587738ba9a3d1ea3633c33fb1, OpenLDAP master
>> now ships and installs a new header <openldap.h> that should expose
>> ldap_init_fd(). Could you check this will work for Samba before we apply
>> this change in 2.4?
> Thanks. I've compiled openldap git master and installed it, I can see
> $prefix/include/openldap.h with ldap_init_fd() and man pages have proper
> references to openldap.h.
> 
> Looks good to me. Once 2.4 becomes available, we can add support of this
> to Samba.

Hi Alexander,
this has been integrated into RE24 and should be available with the
2.4.48 release onwards.

Regards,

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP

Comment 13 abokovoy@redhat.com 2019-06-17 11:38:49 UTC
On ma, 17 kesä 2019, Ondřej Kuzník wrote:
>On Fri, Jun 14, 2019 at 11:50:20AM +0000, abokovoy@redhat.com wrote:
>> On pe, 14 kesä 2019, Ondřej Kuzník wrote:
>>> Hi Alexander,
>>> as of commit 6a5e30674b63b17587738ba9a3d1ea3633c33fb1, OpenLDAP master
>>> now ships and installs a new header <openldap.h> that should expose
>>> ldap_init_fd(). Could you check this will work for Samba before we apply
>>> this change in 2.4?
>> Thanks. I've compiled openldap git master and installed it, I can see
>> $prefix/include/openldap.h with ldap_init_fd() and man pages have proper
>> references to openldap.h.
>>
>> Looks good to me. Once 2.4 becomes available, we can add support of this
>> to Samba.
>
>Hi Alexander,
>this has been integrated into RE24 and should be available with the
>2.4.48 release onwards.
Great, thank you, Ondřej.

-- 
/ Alexander Bokovoy
Sr. Principal Software Engineer
Security / Identity Management Engineering
Red Hat Limited, Finland

Comment 14 OpenLDAP project 2019-07-24 18:57:26 UTC
Fixed in master
Fixed in RE24 (2.4.48)
Comment 15 Quanah Gibson-Mount 2019-07-24 18:57:26 UTC
changed notes
changed state Release to Closed
Comment 16 Quanah Gibson-Mount 2020-03-13 20:59:50 UTC
*** Issue 8833 has been marked as a duplicate of this issue. ***
Comment 17 Quanah Gibson-Mount 2020-03-13 21:00:36 UTC
*** Issue 8834 has been marked as a duplicate of this issue. ***
Comment 18 Quanah Gibson-Mount 2020-03-23 21:04:30 UTC
*** Issue 8982 has been marked as a duplicate of this issue. ***