From 4a68a7bc53df730f4ab6af185abfb4b41558719d Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Sep 16 2010 11:47:16 +0000 Subject: startup error after converting to slapd-config Resolves: #628726 Upstream ITS: #6465 --- diff --git a/openldap-2.4.21-config_emtpy_uri.patch b/openldap-2.4.21-config_emtpy_uri.patch new file mode 100644 index 0000000..ffeb8a8 --- /dev/null +++ b/openldap-2.4.21-config_emtpy_uri.patch @@ -0,0 +1,55 @@ +Don't unparse empty uri string. + +Resolves: #628726 +Upstream ITS: #6465 (http://www.openldap.org/its/index.cgi/Software%20Bugs?id=6465) + +diff -urpNP openldap-2.4.21/servers/slapd/config.c openldap-2.4.21.new/servers/slapd/config.c +--- openldap-2.4.21/servers/slapd/config.c 2009-12-12 07:18:52.000000000 +0100 ++++ openldap-2.4.21.new/servers/slapd/config.c 2010-09-16 13:44:43.574647921 +0200 +@@ -1458,23 +1458,31 @@ slap_cf_aux_table_unparse( void *src, st + break; + + case 'x': +- *ptr++ = ' '; +- ptr = lutil_strcopy( ptr, tab->key.bv_val ); +- if ( tab->quote ) *ptr++ = '"'; +- if ( tab->aux != NULL ) { +- struct berval value; +- slap_cf_aux_table_parse_x *func = (slap_cf_aux_table_parse_x *)tab->aux; +- int rc; +- +- value.bv_val = ptr; +- value.bv_len = buf + sizeof( buf ) - ptr; +- +- rc = func( &value, (void *)((char *)src + tab->off), tab, "(unparse)", 1 ); +- if ( rc == 0 ) { +- ptr += value.bv_len; ++ { ++ char *saveptr=ptr; ++ *ptr++ = ' '; ++ ptr = lutil_strcopy( ptr, tab->key.bv_val ); ++ if ( tab->quote ) *ptr++ = '"'; ++ if ( tab->aux != NULL ) { ++ struct berval value; ++ slap_cf_aux_table_parse_x *func = (slap_cf_aux_table_parse_x *)tab->aux; ++ int rc; ++ ++ value.bv_val = ptr; ++ value.bv_len = buf + sizeof( buf ) - ptr; ++ ++ rc = func( &value, (void *)((char *)src + tab->off), tab, "(unparse)", 1 ); ++ if ( rc == 0 ) { ++ if (value.bv_len) { ++ ptr += value.bv_len; ++ } else { ++ ptr = saveptr; ++ break; ++ } ++ } + } ++ if ( tab->quote ) *ptr++ = '"'; + } +- if ( tab->quote ) *ptr++ = '"'; + break; + + default: diff --git a/openldap-2.4.22-config_emtpy_uri.patch b/openldap-2.4.22-config_emtpy_uri.patch new file mode 100644 index 0000000..a291e5e --- /dev/null +++ b/openldap-2.4.22-config_emtpy_uri.patch @@ -0,0 +1,59 @@ +Don't unparse empty uri string. + +Resolves: #628726 +Upstream ITS: #6465 (http://www.openldap.org/its/index.cgi/Software%20Bugs?id=6465) + +--- config.c 2010-09-16 12:52:26.595773834 +0200 ++++ config.c 2010-09-16 12:51:30.492649769 +0200 +@@ -1,5 +1,5 @@ + /* config.c - configuration file handling routines */ +-/* $OpenLDAP: old/servers/slapd/config.c,v 1.512 2009/12/18 18:07:16 ando Exp $ */ ++/* $OpenLDAP: new/servers/slapd/config.c,v 1.513 2010/02/02 13:43:21 ralf Exp $ */ + /* This work is part of OpenLDAP Software . + * + * Copyright 1998-2009 The OpenLDAP Foundation. +@@ -1545,23 +1545,31 @@ + break; + + case 'x': +- *ptr++ = ' '; +- ptr = lutil_strcopy( ptr, tab->key.bv_val ); +- if ( tab->quote ) *ptr++ = '"'; +- if ( tab->aux != NULL ) { +- struct berval value; +- slap_cf_aux_table_parse_x *func = (slap_cf_aux_table_parse_x *)tab->aux; +- int rc; ++ { ++ char *saveptr=ptr; ++ *ptr++ = ' '; ++ ptr = lutil_strcopy( ptr, tab->key.bv_val ); ++ if ( tab->quote ) *ptr++ = '"'; ++ if ( tab->aux != NULL ) { ++ struct berval value; ++ slap_cf_aux_table_parse_x *func = (slap_cf_aux_table_parse_x *)tab->aux; ++ int rc; + +- value.bv_val = ptr; +- value.bv_len = buf + sizeof( buf ) - ptr; ++ value.bv_val = ptr; ++ value.bv_len = buf + sizeof( buf ) - ptr; + +- rc = func( &value, (void *)((char *)src + tab->off), tab, "(unparse)", 1 ); +- if ( rc == 0 ) { +- ptr += value.bv_len; ++ rc = func( &value, (void *)((char *)src + tab->off), tab, "(unparse)", 1 ); ++ if ( rc == 0 ) { ++ if (value.bv_len) { ++ ptr += value.bv_len; ++ } else { ++ ptr = saveptr; ++ break; ++ } ++ } + } ++ if ( tab->quote ) *ptr++ = '"'; + } +- if ( tab->quote ) *ptr++ = '"'; + break; + + default: diff --git a/openldap.spec b/openldap.spec index 2401847..648a5c8 100644 --- a/openldap.spec +++ b/openldap.spec @@ -11,7 +11,7 @@ Summary: LDAP support libraries Name: openldap Version: %{version} -Release: 10%{?dist} +Release: 11%{?dist} License: OpenLDAP Group: System Environment/Daemons Source0: ftp://ftp.OpenLDAP.org/pub/OpenLDAP/openldap-release/openldap-%{version}.tgz @@ -37,6 +37,7 @@ Patch10: openldap-2.4.6-multilib.patch Patch11: openldap-2.4.16-doc-cacertdir.patch Patch12: openldap-2.4.21-dn2id-segfault.patch Patch13: openldap-2.4.21-modrdn-segfault.patch +Patch14: openldap-2.4.21-config_emtpy_uri.patch # Patches for the evolution library Patch200: openldap-2.4.6-evolution-ntlm.patch @@ -134,6 +135,7 @@ pushd openldap-%{version} %patch11 -p1 -b .cacertdir %patch12 -p1 -b .segfault %patch13 -p1 -b .modrdn-segfault +%patch14 -p1 -b .config-emtpy-uri cp %{_datadir}/libtool/config/config.{sub,guess} build/ popd @@ -651,6 +653,9 @@ fi %attr(0644,root,root) %{evolution_connector_libdir}/*.a %changelog +* Thu Sep 16 2010 Jan Vcelak 2.4.21-11 +- fix: startup error after converting to slapd-config (#628726) + * Tue Jul 20 2010 Jan Vcelak - 2.4.21-10 - CVE-2010-0211 openldap: modrdn processing uninitialized pointer free (#605448) - CVE-2010-0212 openldap: modrdn processing IA5StringNormalize NULL pointer dereference (#605452)