diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-06-13 14:12:11 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-06-13 14:13:54 +0300 |
commit | cf252e67066e7093a3f032f9449022987a1e810b (patch) | |
tree | 4775166193469b8fc3ada02a309d34145a8fdc08 /main | |
parent | a8829e6940a257c1cb1214dd05ae2058169f3799 (diff) | |
download | aports-cf252e67066e7093a3f032f9449022987a1e810b.tar.bz2 aports-cf252e67066e7093a3f032f9449022987a1e810b.tar.xz |
main/openldap: fix sql backend on 64-bit architectures
Diffstat (limited to 'main')
-rw-r--r-- | main/openldap/APKBUILD | 4 | ||||
-rw-r--r-- | main/openldap/openldap-back-sql-fix-64bit.patch | 82 |
2 files changed, 85 insertions, 1 deletions
diff --git a/main/openldap/APKBUILD b/main/openldap/APKBUILD index 6e5637e52f..055b82a57e 100644 --- a/main/openldap/APKBUILD +++ b/main/openldap/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=openldap pkgver=2.4.25 -pkgrel=0 +pkgrel=1 pkgdesc="LDAP Server" url="http://www.openldap.org/" arch="all" @@ -17,6 +17,7 @@ install="$pkgname.pre-install $pkgname.post-install" source="ftp://ftp.$pkgname.org/pub/OpenLDAP/$pkgname-release/$pkgname-$pkgver.tgz openldap-2.4-ppolicy.patch openldap-2.4.11-libldap_r.patch + openldap-back-sql-fix-64bit.patch slapd.initd slapd.confd slurpd.initd @@ -109,6 +110,7 @@ monitor() { _backend monitor; } md5sums="ec63f9c2add59f323a0459128846905b openldap-2.4.25.tgz 2524e490ba334a760fa57057c16da7a9 openldap-2.4-ppolicy.patch d19d0502f046078ecd737e29e7552fa8 openldap-2.4.11-libldap_r.patch +226eefb3e17810f453b76cbc9d1bdbad openldap-back-sql-fix-64bit.patch a729bf553d12b4a9fbda0ff5202a0443 slapd.initd b672311fca605c398240cd37a2ae080a slapd.confd fa5ce0005ef5f1160b6ff126f97aaa1a slurpd.initd" diff --git a/main/openldap/openldap-back-sql-fix-64bit.patch b/main/openldap/openldap-back-sql-fix-64bit.patch new file mode 100644 index 0000000000..82707d4e73 --- /dev/null +++ b/main/openldap/openldap-back-sql-fix-64bit.patch @@ -0,0 +1,82 @@ +From: Timo Teräs <timo.teras@iki.fi> + +Fix openldap memory corruption with back-sql on 64-bit architectures. + +--- openldap-2.4.25/servers/slapd/back-sql/add.c ++++ openldap-2.4.25.patched/servers/slapd/back-sql/add.c +@@ -1217,7 +1217,7 @@ + + if ( !BACKSQL_IS_ADD( oc->bom_expect_return ) ) { + SWORD ncols; +- SQLINTEGER value_len; ++ SQLLEN value_len; + + if ( BACKSQL_CREATE_NEEDS_SELECT( bi ) ) { + SQLFreeStmt( sth, SQL_DROP ); +--- openldap-2.4.25/servers/slapd/back-sql/back-sql.h ++++ openldap-2.4.25.patched/servers/slapd/back-sql/back-sql.h +@@ -183,7 +183,7 @@ + UDWORD *col_prec; + SQLSMALLINT *col_type; + char **cols; +- SQLINTEGER *value_len; ++ SQLLEN *value_len; + } BACKSQL_ROW_NTS; + + /* +--- openldap-2.4.25/servers/slapd/back-sql/proto-sql.h ++++ openldap-2.4.25.patched/servers/slapd/back-sql/proto-sql.h +@@ -189,25 +189,25 @@ + #define backsql_BindParamStr( sth, par_ind, io, str, maxlen ) \ + SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \ + (io), SQL_C_CHAR, SQL_VARCHAR, \ +- (SQLUINTEGER)(maxlen), 0, (SQLPOINTER)(str), \ +- (SQLUINTEGER)(maxlen), NULL ) ++ (SQLULEN)(maxlen), 0, (SQLPOINTER)(str), \ ++ (SQLLEN)(maxlen), NULL ) + + #define backsql_BindParamBerVal( sth, par_ind, io, bv ) \ + SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \ + (io), SQL_C_CHAR, SQL_VARCHAR, \ +- (SQLUINTEGER)(bv)->bv_len, 0, \ ++ (SQLULEN)(bv)->bv_len, 0, \ + (SQLPOINTER)(bv)->bv_val, \ +- (SQLUINTEGER)(bv)->bv_len, NULL ) ++ (SQLLEN)(bv)->bv_len, NULL ) + + #define backsql_BindParamInt( sth, par_ind, io, val ) \ + SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \ + (io), SQL_C_ULONG, SQL_INTEGER, \ +- 0, 0, (SQLPOINTER)(val), 0, (SQLINTEGER*)NULL ) ++ 0, 0, (SQLPOINTER)(val), 0, (SQLLEN*)NULL ) + + #define backsql_BindParamNumID( sth, par_ind, io, val ) \ + SQLBindParameter( (sth), (SQLUSMALLINT)(par_ind), \ + (io), BACKSQL_C_NUMID, SQL_INTEGER, \ +- 0, 0, (SQLPOINTER)(val), 0, (SQLINTEGER*)NULL ) ++ 0, 0, (SQLPOINTER)(val), 0, (SQLLEN*)NULL ) + + #ifdef BACKSQL_ARBITRARY_KEY + #define backsql_BindParamID( sth, par_ind, io, id ) \ +--- openldap-2.4.25/servers/slapd/back-sql/sql-wrap.c ++++ openldap-2.4.25.patched/servers/slapd/back-sql/sql-wrap.c +@@ -148,7 +148,7 @@ + } else { + SQLCHAR colname[ 64 ]; + SQLSMALLINT name_len, col_type, col_scale, col_null; +- UDWORD col_prec; ++ SQLLEN col_prec; + int i; + + #ifdef BACKSQL_TRACE +@@ -180,8 +180,8 @@ + goto nomem; + } + +- row->value_len = (SQLINTEGER *)ber_memcalloc_x( row->ncols, +- sizeof( SQLINTEGER ), ctx ); ++ row->value_len = (SQLLEN *)ber_memcalloc_x( row->ncols, ++ sizeof( SQLLEN ), ctx ); + if ( row->value_len == NULL ) { + goto nomem; + } |