The attached files is derived from OpenLDAP Software. All of the modifications
to OpenLDAP Software represented in the following patch(es) were developed by
Peter-Service LLC, Moscow, Russia. Peter-Service LLC has not assigned rights
and/or interest in this work to any party. I, Leonid Yuriev am authorized by
Peter-Service LLC, my employer, to release this work under the following terms.
Peter-Service LLC hereby places 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.
https://github.com/leo-yuriev/openldap-lmdb-challenge/commit/1d29214f60300c…
Author: Leo Yuriev <leo(a)yuriev.ru>
Date: 2014-10-14 14:49:25 +0400
BUGFIX - lmdb-backend: heap corruption due to returning a
reference to the local variable.
diff --git a/servers/slapd/back-mdb/dn2id.c b/servers/slapd/back-mdb/dn2id.c
index 06e6ad3..41c4758 100644
--- a/servers/slapd/back-mdb/dn2id.c
+++ b/servers/slapd/back-mdb/dn2id.c
@@ -346,7 +346,7 @@ mdb_dn2id(
cursor = mc;
} else {
rc = mdb_cursor_open( txn, dbi, &cursor );
- if ( rc ) return rc;
+ if ( rc ) goto done;
}
for (;;) {
@@ -470,7 +470,7 @@ mdb_dn2sups(
key.mv_size = sizeof(ID);
rc = mdb_cursor_open( txn, dbi, &cursor );
- if ( rc ) return rc;
+ if ( rc ) goto done;
for (;;) {
key.mv_data = &pid;
kenel.bastoon(a)gmail.com wrote:
> Full_Name: Bastien Bonnefon
> Version: 2.4.39
> OS: CentOS 7
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (194.2.202.93)
>
>
> Hi,
>
> I have installed openldap as meta directory to request multiple Active
> Directory.
> I have managed to install and make it work with dynamic configuration or
> slapd.conf.
> But one of the applications accessing the directory needs paged results due to
> the large amount of entries returned.
>
> So I've searched and found the directive "client-pr", which seems to have been
> enabled since this case :
> http://www.openldap.org/its/index.cgi/Software%20Enhancements?id=6664;page=4
>
> The directive is also dcribibed in the slapd-meta man page :
> http://www.openldap.org/software/man.cgi?query=slapd-meta&apropos=0&sektion…
Looking at the ITS history, it appears that this code was released in January
2011 but in fact, the released code is not actually enabled. (It is behind an
#ifdef LDAP_DEVEL mask.) Most likely a mistake was made in releasing it at
that time, since I see no actual test feedback in the ITS.
If you want to test this you will have to compile back-meta yourself, and edit
back-meta.h to make sure SLAPD_META_CLIENT_PR gets defined instead of being
hidden. Please then send your test results as a followup to ITS#6664.
> However, enabling the feature in slapd.conf (I just can't in olc format) doesn't
> work. Syslog shows this :
> "unknown directive <client-pr> inside backend database definition"
>
> I've started testing with CentOS 7 and package openldap 2.4.39
> I've then tried with Debian Wheezy and Ubuntu 14.04 (package slapd 2.4.31)
> I've also tried installing openldap from the source with the version 2.4.24
> (client-pr should have been enabled in this version due to ITS#6664) => no way
> :/
>
> I think I've declared the directive as specified in the man page but maybe I
> miss something. I have not found any other report on the web on how to use
> "client-pr".
> Thank you for your help.
>
>
> Here is my slapd.conf
>
> # Include
> include /etc/ldap/schema/core.schema
> include /etc/ldap/schema/cosine.schema
> include /etc/ldap/schema/inetorgperson.schema
> include /etc/ldap/schema/nis.schema
>
> pidfile /var/run/slapd/slapd.pid
> argsfile /var/run/slapd/slapd.args
>
> # Modules
> moduleload back_ldap.la
> moduleload back_meta.la
>
> # Database meta
> database meta
> suffix "dc=meta,dc=local"
>
> rootdn "cn=Manager,dc=meta,dc=local"
> rootpw secret_password1
>
> # First directory
> uri "ldap://192.168.0.1/ou=test1,dc=meta,dc=local"
> client-pr accept-unsolicited
> lastmod off
> suffixmassage "ou=test1,dc=meta,dc=local" "dc=test1,dc=local"
> idassert-bind bimemethod=simple
> binddn="cn=openldap,OU=users,OU=TEST,dc=test1,dc=local"
> credentials="secret_password2"
> mode=none
> flags=non-prescriptive
> idassert-authzFrom "dn.exact:cn=Manager,dc=meta,dc=local"
> chase-referrals no
> acl-authcDN cn=openldap,OU=users,OU=TEST,dc=test1,dc=local
> acl-passwd secret_password2
>
> # Second Directory
> uri "ldap://192.168.0.2/ou=test2,dc=meta,dc=local"
> client-pr accept-unsolicited
> lastmod off
> suffixmassage "ou=test2,dc=meta,dc=local" ,%c=test2,dc=local"
> idassert-bind bindmethod=simple
> binddn="cn=openldap,OU=users,OU=TEST,dc=test2,dc=local"
> credentials="secret_password3"
> mode=none
> flags=non-prescriptive
> idassert-authzFrom "dn.exact:cn=Manager,dc=meta,dc=local"
> chase-referrals no
> acl-authcDN "cn=openldap,OU=users,OU=TEST,dc=test2,dc=local"
> acl-passwd secret_password3
>
>
> idletimeout 1800
>
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
Full_Name: Bastien Bonnefon
Version: 2.4.39
OS: CentOS 7
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (194.2.202.93)
Hi,
I have installed openldap as meta directory to request multiple Active
Directory.
I have managed to install and make it work with dynamic configuration or
slapd.conf.
But one of the applications accessing the directory needs paged results due to
the large amount of entries returned.
So I've searched and found the directive "client-pr", which seems to have been
enabled since this case :
http://www.openldap.org/its/index.cgi/Software%20Enhancements?id=6664;page=4
The directive is also dcribibed in the slapd-meta man page :
http://www.openldap.org/software/man.cgi?query=slapd-meta&apropos=0&sektion…
However, enabling the feature in slapd.conf (I just can't in olc format) doesn't
work. Syslog shows this :
"unknown directive <client-pr> inside backend database definition"
I've started testing with CentOS 7 and package openldap 2.4.39
I've then tried with Debian Wheezy and Ubuntu 14.04 (package slapd 2.4.31)
I've also tried installing openldap from the source with the version 2.4.24
(client-pr should have been enabled in this version due to ITS#6664) => no way
:/
I think I've declared the directive as specified in the man page but maybe I
miss something. I have not found any other report on the web on how to use
"client-pr".
Thank you for your help.
Here is my slapd.conf
# Include
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/nis.schema
pidfile /var/run/slapd/slapd.pid
argsfile /var/run/slapd/slapd.args
# Modules
moduleload back_ldap.la
moduleload back_meta.la
# Database meta
database meta
suffix "dc=meta,dc=local"
rootdn "cn=Manager,dc=meta,dc=local"
rootpw secret_password1
# First directory
uri "ldap://192.168.0.1/ou=test1,dc=meta,dc=local"
client-pr accept-unsolicited
lastmod off
suffixmassage "ou=test1,dc=meta,dc=local" "dc=test1,dc=local"
idassert-bind bimemethod=simple
binddn="cn=openldap,OU=users,OU=TEST,dc=test1,dc=local"
credentials="secret_password2"
mode=none
flags=non-prescriptive
idassert-authzFrom "dn.exact:cn=Manager,dc=meta,dc=local"
chase-referrals no
acl-authcDN cn=openldap,OU=users,OU=TEST,dc=test1,dc=local
acl-passwd secret_password2
# Second Directory
uri "ldap://192.168.0.2/ou=test2,dc=meta,dc=local"
client-pr accept-unsolicited
lastmod off
suffixmassage "ou=test2,dc=meta,dc=local" ,%c=test2,dc=local"
idassert-bind bindmethod=simple
binddn="cn=openldap,OU=users,OU=TEST,dc=test2,dc=local"
credentials="secret_password3"
mode=none
flags=non-prescriptive
idassert-authzFrom "dn.exact:cn=Manager,dc=meta,dc=local"
chase-referrals no
acl-authcDN "cn=openldap,OU=users,OU=TEST,dc=test2,dc=local"
acl-passwd secret_password3
idletimeout 1800
jcd(a)tribudubois.net wrote:
> Full_Name: Jean-Christophe Dubois
> Version: 2.4.40
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (78.235.240.156)
>
>
> In function mdb_txn_begin() at line 2672 there is a check for the parent
> pointer.
>
> The same check is done few lines earlier (line 2665) and if the condition was
> met the program would have skip the all section to ok:
>
> So code line 2673 can never be reached. It could be removed.
Thanks. This was leftover from 4d02c741b120786df1b87ee9ed49c1d3f9bc7522. Fixed
in mdb.master.
>
> Patch available at URL below:
>
> https://github.com/jcdubois/lmdb/commit/a3770a5fef56417ceea677efbbde7687551…
>
> JC
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
Full_Name: Jean-Christophe Dubois
Version: 2.4.40
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (78.235.240.156)
In function mdb_txn_begin() at line 2672 there is a check for the parent
pointer.
The same check is done few lines earlier (line 2665) and if the condition was
met the program would have skip the all section to ok:
So code line 2673 can never be reached. It could be removed.
Patch available at URL below:
https://github.com/jcdubois/lmdb/commit/a3770a5fef56417ceea677efbbde7687551…
JC
Full_Name: Jean-Christophe Dubois
Version: 2.4.40
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (78.235.240.156)
In function mdb_txn_begin() at line 2672 there is a check for the parent
pointer.
The same check is done few lines earlier (line 2665) and if the condition was
met the program would have skip the all section to ok:
So code line 2673 can never be reached. It could be removed.
Patch available at URL below:
https://github.com/jcdubois/lmdb/commit/a3770a5fef56417ceea677efbbde7687551…
JC