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

RE: (ITS#5919) URI syntaxe (ldap:///dc=my%2cdc=domaine)



This is a multi-part message in MIME format.

------=_NextPart_000_00B1_01C987A2.419734D0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

and patch could be something like that ...
--
pe

-----Message d'origine-----
De : Philippe EYCHART [mailto:philippe.eychart@informatique.gov.pf]
Envoye : jeudi 5 fevrier 2009 11:33
A : h.b.furuseth@usit.uio.no; ando@sys-net.it
Cc : openldap-its@openldap.org
Objet : RE: (ITS#5919) URI syntaxe (ldap:///dc=my%2cdc=domaine)


And what do you think about : ldap://.nameOfSrvDomainSearch/ ('.' at
begining of the hostname to say "use SRV record" of this domain - search
domain(s) if only '.') ?...
--
pe

-----Message d'origine-----
De : Hallvard Breien Furuseth [mailto:h.b.furuseth@usit.uio.no]
Envoye : mercredi 4 fevrier 2009 05:02
A : Philippe.eychart@informatique.gov.pf
Cc : openldap-its@openldap.org
Objet : Re: (ITS#5919) URI syntaxe (ldap:///dc=my%2cdc=domaine)


I'm not quite sure if it's a good idea to move ldap SRV lookup into
ldap_initialize(), since ldap:/// is also means "this LDAP server" in
referral objects and some slapd backends.  Possibly some other syntax
should be used to say "use SRV record", e.g. "ldap://./";, or another
function could work like ldap_initialize() but be more clever.  Though a
helper function which copies clients/tools/common.c:tool_conn_setup()
functionality could in any case be useful.

Also note that _ldap._tcp.domain is of limited utility outside
Windows-land, because Microsoft annexed it for Active Directory:
On a site which has Windows and Active Directory, _ldap._tcp.domain
is normally required to refer to Active Directory.  Thus if such
a site uses another LDAP server for their public LDAP data, they
can't _ldap._tcp.domain for that.

--
Hallvard


------=_NextPart_000_00B1_01C987A2.419734D0
Content-Type: application/octet-stream;
	name="open.c.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="open.c.patch"

--- openldap-2.4.13/libraries/libldap/open.c	2008-10-31 =
13:23:58.000000000 -1000=0A=
+++ openldap-2.4.13/libraries/libldap/open.c	2009-02-05 =
14:34:14.000000000 -1000=0A=
@@ -212,19 +212,33 @@=0A=
 	return( ld );=0A=
 }=0A=
 =0A=
+char *=0A=
+url_expand_on_srv_search ( const char *url_in )=0A=
+{=0A=
+	// soon=0A=
+=0A=
+	return LDAP_STRDUP( url_in );=0A=
+}=0A=
+=0A=
 =0A=
 int=0A=
-ldap_initialize( LDAP **ldp, LDAP_CONST char *url )=0A=
+ldap_initialize( LDAP **ldp, const char *url_in )=0A=
 {=0A=
 	int rc;=0A=
 	LDAP *ld;=0A=
+	char *url;=0A=
 =0A=
 	*ldp =3D NULL;=0A=
 	rc =3D ldap_create(&ld);=0A=
 	if ( rc !=3D LDAP_SUCCESS )=0A=
 		return rc;=0A=
 =0A=
-	if (url !=3D NULL) {=0A=
+	if (url_in !=3D NULL) {=0A=
+		url =3D url_expand_on_srv_search ( url_in );=0A=
+		if ( url =3D=3D NULL ) {=0A=
+			return LDAP_URL_ERR_MEM;=0A=
+		}=0A=
+=0A=
 		rc =3D ldap_set_option(ld, LDAP_OPT_URI, url);=0A=
 		if ( rc !=3D LDAP_SUCCESS ) {=0A=
 			ldap_ld_free(ld, 1, NULL, NULL);=0A=
@@ -234,6 +248,7 @@=0A=
 		if (ldap_is_ldapc_url(url))=0A=
 			LDAP_IS_UDP(ld) =3D 1;=0A=
 #endif=0A=
+		LDAP_FREE( url );=0A=
 	}=0A=
 =0A=
 	*ldp =3D ld;=0A=

------=_NextPart_000_00B1_01C987A2.419734D0--