[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Status of ldap_init_fd and LDAP_PROTO_EXT?



Hi,

On 08.05.2017 15:10, Volker Lendecke wrote:
On Mon, May 08, 2017 at 11:57:28AM +0100, Howard Chu wrote:
Generally, <ldap.h> was only supposed to export the "official" LDAP API and
anything that was specific to OpenLDAP's implementation was stashed in
<ldap_pvt.h> as non-standard features. I suppose the distinction is somewhat
meaningless these days since the last LDAP API RFC was only valid for LDAPv2
and a version for LDAPv3 was never approved. At this point, OpenLDAP's API
is the de facto standard. As clumsy as it may be...

So I'm getting from this that ldap_pvt.h should be installed and that
you don't plan to change this arbitrarily. "pvt" to me meant
"private". For Samba, if we have a "private" API, we take the liberty
to change this without real notice.

Was there any conclusive decision? May be the attached patch could help to get things moving?

We'd like to use ldap_init_fd() in Samba and if it is OK to use it, may be moving it to <ldap.h> is a good solution?

--
/ Alexander Bokovoy
>From 6b459d214d31e75674aa9893bd5bed37f8cabdfa Mon Sep 17 00:00:00 2001
From: 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           | 4 ++++
 include/ldap_pvt.h       | 4 +---
 3 files changed, 6 insertions(+), 7 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 open 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..d358663 100644
--- a/include/ldap.h
+++ b/include/ldap.h
@@ -1548,6 +1548,10 @@ LDAP_F( LDAP * )
 ldap_dup LDAP_P((
 	LDAP *old ));
 
+/* 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..62c64b8 100644
--- a/include/ldap_pvt.h
+++ b/include/ldap_pvt.h
@@ -343,9 +343,7 @@ 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 ));
+	LDAP **ldp, ber_socket_t *fdp ));
 
 /* sasl.c */
 LDAP_F (int) ldap_pvt_sasl_generic_install LDAP_P(( Sockbuf *sb,
-- 
2.9.3