[openldap] fix: slapd with rwm overlay segfault following ldapmodify

jvcelak jvcelak at fedoraproject.org
Fri Oct 12 06:59:15 UTC 2012


commit 17508fb68c16141c0e60ba3b20609f845d8edaba
Author: Jan Vcelak <jvcelak at redhat.com>
Date:   Fri Oct 12 08:58:01 2012 +0200

    fix: slapd with rwm overlay segfault following ldapmodify
    
    Resolves: #865685

 openldap-rwm-slapd-segfault-modrdn.patch |   33 ++++++++++++++++++++++++++++++
 openldap.spec                            |    7 +++++-
 2 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/openldap-rwm-slapd-segfault-modrdn.patch b/openldap-rwm-slapd-segfault-modrdn.patch
new file mode 100644
index 0000000..5375f69
--- /dev/null
+++ b/openldap-rwm-slapd-segfault-modrdn.patch
@@ -0,0 +1,33 @@
+fix: slapd with rwm overlay segfault following ldapmodify
+
+(newSup is NULL if it was specified, but same as old Sup)
+
+Author: Howard Chu <hyc at openldap.org>
+Upstream ITS: #7414
+Upstream commit: d42c7c4
+Resolves: #865685
+
+diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c
+index cc6211e..d12fd0f 100644
+--- a/servers/slapd/overlays/rwm.c
++++ b/servers/slapd/overlays/rwm.c
+@@ -107,10 +107,12 @@ rwm_op_rollback( Operation *op, SlapReply *rs, rwm_op_state *ros )
+ 		break;
+ 	case LDAP_REQ_MODRDN:
+ 		if ( op->orr_newSup != ros->orr_newSup ) {
+-			ch_free( op->orr_newSup->bv_val );
+-			ch_free( op->orr_nnewSup->bv_val );
+-			op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
+-			op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
++			if ( op->orr_newSup ) {
++				ch_free( op->orr_newSup->bv_val );
++				ch_free( op->orr_nnewSup->bv_val );
++				op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
++				op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
++			}
+ 			op->orr_newSup = ros->orr_newSup;
+ 			op->orr_nnewSup = ros->orr_nnewSup;
+ 		}
+-- 
+1.7.11.7
+
diff --git a/openldap.spec b/openldap.spec
index 904331a..2975b8e 100644
--- a/openldap.spec
+++ b/openldap.spec
@@ -8,7 +8,7 @@
 
 Name: openldap
 Version: 2.4.33
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: LDAP support libraries
 Group: System Environment/Daemons
 License: OpenLDAP
@@ -44,6 +44,7 @@ Patch12: openldap-tls-no-reuse-of-tls_session.patch
 Patch13: openldap-nss-regex-search-hashed-cacert-dir.patch
 Patch14: openldap-nss-ignore-certdb-type-prefix.patch
 Patch15: openldap-nss-certs-from-certdb-fallback-pem.patch
+Patch16: openldap-rwm-slapd-segfault-modrdn.patch
 
 # Fedora specific patches
 Patch100: openldap-autoconf-pkgconfig-nss.patch
@@ -161,6 +162,7 @@ ln -s %{_includedir}/nspr4 include/nspr
 %patch13 -p1
 %patch14 -p1
 %patch15 -p1
+%patch16 -p1
 
 %patch102 -p1
 
@@ -618,6 +620,9 @@ exit 0
 %{evolution_connector_prefix}/
 
 %changelog
+* Fri Oct 12 2012 Jan Vcelak <jvcelak at redhat.com> 2.4.33-2
+- fix: slapd with rwm overlay segfault following ldapmodify (#865685)
+
 * Thu Oct 11 2012 Jan Vcelak <jvcelak at redhat.com> 2.4.33-1
 - new upstream release:
   + slapd: ACLs, syncrepl


More information about the scm-commits mailing list