From eab1b48bc41fa8265b75bbe979e0f0666d4a8a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0afr=C3=A1nek?= Date: Tue, 7 Aug 2007 07:08:43 +0000 Subject: [PATCH] db 4.6.18 integrated License: updated Compilation with new glibc fixed --- .cvsignore | 1 + db-4.3.29-sparc64.patch | 18 ++ db-4.4.20-1.patch | 31 -- db-4.4.20-2.patch | 32 -- db-4.5.20-jni-include-dir.patch | 11 + db-4.6.18-glibc.patch | 455 +++++++++++++++++++++++++++++ openldap-2.3.37-fortify-open.patch | 61 ++++ openldap.spec | 12 + sources | 2 +- 9 files changed, 559 insertions(+), 64 deletions(-) create mode 100644 db-4.3.29-sparc64.patch delete mode 100644 db-4.4.20-1.patch delete mode 100644 db-4.4.20-2.patch create mode 100644 db-4.5.20-jni-include-dir.patch create mode 100644 db-4.6.18-glibc.patch create mode 100644 openldap-2.3.37-fortify-open.patch diff --git a/.cvsignore b/.cvsignore index e3eb5a1..10f909c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -8,3 +8,4 @@ openldap-2.3.28.tgz openldap-2.3.30.tgz openldap-2.3.34.tgz openldap-2.3.37.tgz +db-4.6.18.tar.gz diff --git a/db-4.3.29-sparc64.patch b/db-4.3.29-sparc64.patch new file mode 100644 index 0000000..74f83fe --- /dev/null +++ b/db-4.3.29-sparc64.patch @@ -0,0 +1,18 @@ +--- db-4.3.29/dist/configure.ac.BAD 2006-07-13 17:59:04.000000000 -0400 ++++ db-4.3.29/dist/configure.ac 2006-07-13 17:59:32.000000000 -0400 +@@ -291,11 +291,11 @@ + INSTALLER="\$(LIBTOOL) --mode=install cp -p" + + MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}" +-MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version" +-MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK}" ++MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} ${CFLAGS} -avoid-version" ++MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} ${CFLAGS}" + MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${MAKEFILE_CXX}" +-MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -avoid-version" +-MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}" ++MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} ${CFLAGS} -avoid-version" ++MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} ${CFLAGS}" + + LIBTOOL="\$(SHELL) ./libtool" + diff --git a/db-4.4.20-1.patch b/db-4.4.20-1.patch deleted file mode 100644 index 463d942..0000000 --- a/db-4.4.20-1.patch +++ /dev/null @@ -1,31 +0,0 @@ -Fix a bug that could cause a trap during recovery if multiple -operations that could remove the same extent were recovered. [#14061] - - -*** qam/qam_files.c.orig 2005-10-20 11:57:12.000000000 -0700 ---- qam/qam_files.c 2006-01-27 13:38:38.000000000 -0800 -*************** -*** 411,416 **** ---- 411,422 ---- - DB_APP_DATA, buf, 0, NULL, &real_name)) != 0) - goto err; - #endif -+ -+ mpf = array->mpfarray[offset].mpf; -+ /* This extent my already be marked for delete and closed. */ -+ if (mpf == NULL) -+ goto err; -+ - /* - * The log must be flushed before the file is deleted. We depend on - * the log record of the last delete to recreate the file if we crash. -*************** -*** 418,424 **** - if (LOGGING_ON(dbenv) && (ret = __log_flush(dbenv, NULL)) != 0) - goto err; - -- mpf = array->mpfarray[offset].mpf; - (void)__memp_set_flags(mpf, DB_MPOOL_UNLINK, 1); - /* Someone could be real slow, let them close it down. */ - if (array->mpfarray[offset].pinref != 0) ---- 424,429 ---- diff --git a/db-4.4.20-2.patch b/db-4.4.20-2.patch deleted file mode 100644 index a994810..0000000 --- a/db-4.4.20-2.patch +++ /dev/null @@ -1,32 +0,0 @@ -Fix a bug that could cause traps or hangs if the DB_TXN->set_name function -is used in a multithreaded application. [#14033] - - -*** txn/txn.c.orig Tue Nov 1 06:50:03 2005 ---- txn/txn.c Tue Jan 31 15:05:13 2006 -*************** -*** 1049,1060 **** ---- 1049,1062 ---- - return (ret); - memcpy(txn->name, name, len); - -+ TXN_SYSTEM_LOCK(dbenv); - if (td->name != INVALID_ROFF) { - __db_shalloc_free( - &mgr->reginfo, R_ADDR(&mgr->reginfo, td->name)); - td->name = INVALID_ROFF; - } - if ((ret = __db_shalloc(&mgr->reginfo, len, 0, &p)) != 0) { -+ TXN_SYSTEM_UNLOCK(dbenv); - __db_err(dbenv, - "Unable to allocate memory for transaction name"); - -*************** -*** 1063,1068 **** ---- 1065,1071 ---- - - return (ret); - } -+ TXN_SYSTEM_UNLOCK(dbenv); - td->name = R_OFFSET(&mgr->reginfo, p); - memcpy(p, name, len); diff --git a/db-4.5.20-jni-include-dir.patch b/db-4.5.20-jni-include-dir.patch new file mode 100644 index 0000000..d7ce382 --- /dev/null +++ b/db-4.5.20-jni-include-dir.patch @@ -0,0 +1,11 @@ +--- db-4.5.20/dist/configure.ac.orig 2007-03-24 17:56:44.000000000 -0400 ++++ db-4.5.20/dist/configure.ac 2007-03-24 17:57:17.000000000 -0400 +@@ -389,7 +389,7 @@ + AC_PROG_JAVAC + AC_PROG_JAR + AC_PROG_JAVA +- AC_JNI_INCLUDE_DIR ++ JNI_INCLUDE_DIRS="/usr/lib/jvm/java-1.5.0-gcj/include" + + if test x$JAVA != x; then + AC_MSG_CHECKING(java version) diff --git a/db-4.6.18-glibc.patch b/db-4.6.18-glibc.patch new file mode 100644 index 0000000..e8f5669 --- /dev/null +++ b/db-4.6.18-glibc.patch @@ -0,0 +1,455 @@ +--- db-4.6.18/tcl/tcl_db_pkg.c.glibc 2007-07-09 19:38:45.000000000 +0200 ++++ db-4.6.18/tcl/tcl_db_pkg.c 2007-08-06 16:25:43.000000000 +0200 +@@ -1377,7 +1377,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) + * Now open the environment. + */ + _debug_check(); +- ret = (*env)->open(*env, home, open_flags, mode); ++ ret = ((*env)->open)(*env, home, open_flags, mode); + result = _ReturnSetup(interp, ret, DB_RETOK_STD(ret), "env open"); + + if (rep_flags != 0 && result == TCL_OK) { +@@ -2215,7 +2215,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) + _debug_check(); + + /* Open the database. */ +- ret = (*dbp)->open(*dbp, txn, db, subdb, type, open_flags, mode); ++ ret = ((*dbp)->open)(*dbp, txn, db, subdb, type, open_flags, mode); + result = _ReturnSetup(interp, ret, DB_RETOK_STD(ret), "db open"); + + error: +@@ -2476,7 +2476,7 @@ bdb_SeqOpen(interp, objc, objv, ip, seqp + ret, DB_RETOK_STD(ret), "sequence init")) != TCL_OK) + goto error; + } +- ret = (*seqp)->open(*seqp, txn, &key, oflags); ++ ret = ((*seqp)->open)(*seqp, txn, &key, oflags); + if ((result = _ReturnSetup(interp, + ret, DB_RETOK_STD(ret), "sequence open")) != TCL_OK) + goto error; +--- db-4.6.18/tcl/tcl_mp.c.glibc 2007-06-22 19:41:45.000000000 +0200 ++++ db-4.6.18/tcl/tcl_mp.c 2007-08-06 16:26:17.000000000 +0200 +@@ -275,7 +275,7 @@ tcl_Mp(interp, objc, objv, envp, envip) + * XXX + * Interface doesn't currently support DB_MPOOLFILE configuration. + */ +- if ((ret = mpf->open(mpf, file, flag, mode, (size_t)pgsize)) != 0) { ++ if ((ret = (mpf->open)(mpf, file, flag, mode, (size_t)pgsize)) != 0) { + result = _ReturnSetup(interp, ret, DB_RETOK_STD(ret), "mpool"); + _DeleteInfo(ip); + +--- db-4.6.18/dbm/dbm.c.glibc 2007-05-17 17:15:07.000000000 +0200 ++++ db-4.6.18/dbm/dbm.c 2007-08-06 15:26:11.000000000 +0200 +@@ -230,7 +230,7 @@ __db_ndbm_open(file, oflags, mode) + if ((ret = dbp->set_pagesize(dbp, 4096)) != 0 || + (ret = dbp->set_h_ffactor(dbp, 40)) != 0 || + (ret = dbp->set_h_nelem(dbp, 1)) != 0 || +- (ret = dbp->open(dbp, NULL, ++ (ret = (dbp->open)(dbp, NULL, + path, NULL, DB_HASH, __db_oflags(oflags), mode)) != 0) { + __os_set_errno(ret); + return (NULL); +--- db-4.6.18/db_hotbackup/db_hotbackup.c.glibc 2007-05-17 17:15:01.000000000 +0200 ++++ db-4.6.18/db_hotbackup/db_hotbackup.c 2007-08-06 15:26:11.000000000 +0200 +@@ -418,9 +418,9 @@ env_init(dbenvp, home, log_dirp, data_di + * We try to attach to a pre-existing environment; if that + * fails, we create a private environment and try again. + */ +- if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && ++ if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (ret == DB_VERSION_MISMATCH || +- (ret = dbenv->open(dbenv, home, DB_CREATE | ++ (ret = (dbenv->open)(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, + 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open: %s", home); +@@ -445,7 +445,7 @@ env_init(dbenvp, home, log_dirp, data_di + ret, "DB_ENV->set_cachesize: %s", home); + return (1); + } +- if ((ret = dbenv->open(dbenv, home, DB_CREATE | ++ if ((ret = (dbenv->open)(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_PRIVATE | + DB_RECOVER_FATAL | DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->open: %s", home); +--- db-4.6.18/db_checkpoint/db_checkpoint.c.glibc 2007-05-17 17:14:58.000000000 +0200 ++++ db-4.6.18/db_checkpoint/db_checkpoint.c 2007-08-06 15:26:11.000000000 +0200 +@@ -141,9 +141,9 @@ main(argc, argv) + * If attaching to a pre-existing environment fails, create a + * private one and try again. + */ +- if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && ++ if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (!once || ret == DB_VERSION_MISMATCH || +- (ret = dbenv->open(dbenv, home, ++ (ret = (dbenv->open)(dbenv, home, + DB_CREATE | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; +--- db-4.6.18/db_deadlock/db_deadlock.c.glibc 2007-05-17 19:17:42.000000000 +0200 ++++ db-4.6.18/db_deadlock/db_deadlock.c 2007-08-06 15:26:11.000000000 +0200 +@@ -157,7 +157,7 @@ main(argc, argv) + } + + /* An environment is required. */ +- if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0) { ++ if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) != 0) { + dbenv->err(dbenv, ret, "open"); + goto shutdown; + } +--- db-4.6.18/libdb_java/db_java_wrap.c.glibc 2007-06-28 16:23:38.000000000 +0200 ++++ db-4.6.18/libdb_java/db_java_wrap.c 2007-08-06 15:59:38.000000000 +0200 +@@ -2501,7 +2501,7 @@ SWIGINTERN db_ret_t Db_key_range(struct + return self->key_range(self, txnid, key, key_range, flags); + } + SWIGINTERN db_ret_t Db_open(struct Db *self,DB_TXN *txnid,char const *file,char const *database,DBTYPE type,u_int32_t flags,int mode){ +- return self->open(self, txnid, file, database, ++ return (self->open)(self, txnid, file, database, + type, flags, mode); + } + SWIGINTERN int Db_pget(struct Db *self,DB_TXN *txnid,DBT *key,DBT *pkey,DBT *data,u_int32_t flags){ +@@ -2723,7 +2723,7 @@ SWIGINTERN db_ret_t DbEnv_lsn_reset(stru + return self->lsn_reset(self, file, flags); + } + SWIGINTERN db_ret_t DbEnv_open(struct DbEnv *self,char const *db_home,u_int32_t flags,int mode){ +- return self->open(self, db_home, flags, mode); ++ return (self->open)(self, db_home, flags, mode); + } + SWIGINTERN db_ret_t DbEnv_remove(struct DbEnv *self,char const *db_home,u_int32_t flags){ + return self->remove(self, db_home, flags); +@@ -3278,7 +3278,7 @@ SWIGINTERN db_ret_t DbSequence_initial_v + return self->initial_value(self, val); + } + SWIGINTERN db_ret_t DbSequence_open(struct DbSequence *self,DB_TXN *txnid,DBT *key,u_int32_t flags){ +- return self->open(self, txnid, key, flags); ++ return (self->open)(self, txnid, key, flags); + } + SWIGINTERN db_ret_t DbSequence_remove(struct DbSequence *self,DB_TXN *txnid,u_int32_t flags){ + return self->remove(self, txnid, flags); +--- db-4.6.18/rpc_server/cxx/db_server_cxxproc.cpp.glibc 2007-06-28 16:01:21.000000000 +0200 ++++ db-4.6.18/rpc_server/cxx/db_server_cxxproc.cpp 2007-08-06 16:36:12.000000000 +0200 +@@ -336,7 +336,7 @@ __env_open_proc( + replyp->envcl_id = new_ctp->ct_id; + ret = __env_close_int(dbenvcl_id, 0, 0); + } else { +- ret = dbenv->open(fullhome->home, newflags, mode); ++ ret = (dbenv->open)(fullhome->home, newflags, mode); + dbenv_ctp->ct_envdp.home = fullhome; + dbenv_ctp->ct_envdp.envflags = shareflags; + } +@@ -1187,7 +1187,7 @@ __db_open_proc( + ret = __db_close_int(dbpcl_id, 0); + goto out; + } +- ret = dbp->open(txnp, name, subdb, (DBTYPE)type, flags, mode); ++ ret = (dbp->open)(txnp, name, subdb, (DBTYPE)type, flags, mode); + if (ret == 0) { + (void)dbp->get_type(&dbtype); + replyp->type = dbtype; +--- db-4.6.18/rpc_server/cxx/db_server_cxxutil.cpp.glibc 2007-05-17 17:15:52.000000000 +0200 ++++ db-4.6.18/rpc_server/cxx/db_server_cxxutil.cpp 2007-08-06 16:36:26.000000000 +0200 +@@ -730,7 +730,7 @@ env_recover(char *progname) + printf("Running recovery on %s\n", hp->home); + flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | + DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER; +- if ((ret = dbenv->open(hp->home, flags, 0)) != 0) { ++ if ((ret = (dbenv->open)(hp->home, flags, 0)) != 0) { + dbenv->err(ret, "DbEnv->open"); + goto error; + } +--- db-4.6.18/rpc_server/c/db_server_util.c.glibc 2007-05-17 17:15:52.000000000 +0200 ++++ db-4.6.18/rpc_server/c/db_server_util.c 2007-08-06 16:35:47.000000000 +0200 +@@ -802,7 +802,7 @@ env_recover(progname) + printf("Running recovery on %s\n", hp->home); + flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | + DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER; +- if ((ret = dbenv->open(dbenv, hp->home, flags, 0)) != 0) { ++ if ((ret = (dbenv->open)(dbenv, hp->home, flags, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto error; + } +--- db-4.6.18/rpc_server/c/db_server_proc.c.glibc 2007-06-28 15:59:24.000000000 +0200 ++++ db-4.6.18/rpc_server/c/db_server_proc.c 2007-08-06 16:35:28.000000000 +0200 +@@ -394,7 +394,7 @@ __env_open_proc(dbenvcl_id, home, flags, + replyp->envcl_id = new_ctp->ct_id; + ret = __env_close_int(dbenvcl_id, 0, 0); + } else { +- ret = dbenv->open(dbenv, fullhome->home, newflags, mode); ++ ret = (dbenv->open)(dbenv, fullhome->home, newflags, mode); + dbenv_ctp->ct_envdp.home = fullhome; + dbenv_ctp->ct_envdp.envflags = shareflags; + } +@@ -1392,7 +1392,7 @@ __db_open_proc(dbpcl_id, txnpcl_id, name + ret = __db_close_int(dbpcl_id, 0); + goto out; + } +- ret = dbp->open(dbp, txnp, name, subdb, (DBTYPE)type, flags, mode); ++ ret = (dbp->open)(dbp, txnp, name, subdb, (DBTYPE)type, flags, mode); + if (ret == 0) { + (void)dbp->get_type(dbp, &dbtype); + replyp->type = dbtype; +--- db-4.6.18/db_dump/db_dump.c.glibc 2007-05-17 17:14:59.000000000 +0200 ++++ db-4.6.18/db_dump/db_dump.c 2007-08-06 15:26:11.000000000 +0200 +@@ -199,7 +199,7 @@ retry: if ((ret = db_env_create(&dbenv, + goto done; + } + +- if ((ret = dbp->open(dbp, NULL, ++ if ((ret = (dbp->open)(dbp, NULL, + argv[0], subname, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbp->err(dbp, ret, "open: %s", argv[0]); + goto err; +@@ -296,7 +296,7 @@ db_init(dbenv, home, is_salvage, cache, + * before we create our own. + */ + *is_privatep = 0; +- if ((ret = dbenv->open(dbenv, home, ++ if ((ret = (dbenv->open)(dbenv, home, + DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : 0), 0)) == 0) + return (0); + if (ret == DB_VERSION_MISMATCH) +@@ -314,7 +314,7 @@ db_init(dbenv, home, is_salvage, cache, + */ + *is_privatep = 1; + if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) == 0 && +- (ret = dbenv->open(dbenv, home, ++ (ret = (dbenv->open)(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) == 0) + return (0); + +@@ -367,7 +367,7 @@ dump_sub(dbenv, parent_dbp, parent_name, + free(subdb); + return (1); + } +- if ((ret = dbp->open(dbp, NULL, ++ if ((ret = (dbp->open)(dbp, NULL, + parent_name, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) + dbp->err(dbp, ret, + "DB->open: %s:%s", parent_name, subdb); +--- db-4.6.18/db_codegen/code_capi.c.glibc 2007-06-05 16:06:25.000000000 +0200 ++++ db-4.6.18/db_codegen/code_capi.c 2007-08-06 15:26:11.000000000 +0200 +@@ -368,7 +368,7 @@ static int\nbdb_env_startup(env_list_t * + \tif (ep->transaction)\n\ + \t open_flags |= DB_INIT_LOCK |\n\ + \t DB_INIT_LOG | DB_INIT_TXN | DB_RECOVER;\n\ +-\tif ((ret = dbenv->open(dbenv, ep->home, open_flags, 0)) != 0) {\n\ ++\tif ((ret = (dbenv->open)(dbenv, ep->home, open_flags, 0)) != 0) {\n\ + \t dbenv->err(dbenv, ret, \"DB_ENV->open: %%s\", ep->home);\n\ + \t goto err;\n\ + \t}\n\ +@@ -487,7 +487,7 @@ api_c_db() + + fprintf(of, "\ + \n\ +-\tif ((ret = dbp->open(dbp, NULL, dp->name, NULL, dp->type,\n\ ++\tif ((ret = (dbp->open)(dbp, NULL, dp->name, NULL, dp->type,\n\ + \t (dp->transaction ? DB_AUTO_COMMIT : 0) |\n\ + \t DB_CREATE | DB_THREAD, 0)) != 0) {\n\ + \t\tdbp->err(dbp, ret, \"DB->open: %%s\", dp->name);\n\ +--- db-4.6.18/db_upgrade/db_upgrade.c.glibc 2007-05-17 17:15:04.000000000 +0200 ++++ db-4.6.18/db_upgrade/db_upgrade.c 2007-08-06 15:26:11.000000000 +0200 +@@ -119,9 +119,9 @@ main(argc, argv) + * If attaching to a pre-existing environment fails, create a + * private one and try again. + */ +- if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && ++ if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (ret == DB_VERSION_MISMATCH || +- (ret = dbenv->open(dbenv, home, ++ (ret = (dbenv->open)(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, + 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open"); +--- db-4.6.18/db_archive/db_archive.c.glibc 2007-05-17 17:14:58.000000000 +0200 ++++ db-4.6.18/db_archive/db_archive.c 2007-08-06 15:26:11.000000000 +0200 +@@ -119,9 +119,9 @@ main(argc, argv) + * If attaching to a pre-existing environment fails, create a + * private one and try again. + */ +- if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && ++ if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (ret == DB_VERSION_MISMATCH || +- (ret = dbenv->open(dbenv, home, DB_CREATE | ++ (ret = (dbenv->open)(dbenv, home, DB_CREATE | + DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; +--- db-4.6.18/db_printlog/db_printlog.c.glibc 2007-06-01 17:36:50.000000000 +0200 ++++ db-4.6.18/db_printlog/db_printlog.c 2007-08-06 15:26:11.000000000 +0200 +@@ -173,18 +173,18 @@ main(argc, argv) + * with logging, because we don't want to log the opens. + */ + if (repflag) { +- if ((ret = dbenv->open(dbenv, home, ++ if ((ret = (dbenv->open)(dbenv, home, + DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0 && + (ret == DB_VERSION_MISMATCH || +- (ret = dbenv->open(dbenv, home, ++ (ret = (dbenv->open)(dbenv, home, + DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) + != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; + } +- } else if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && ++ } else if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) != 0 && + (ret == DB_VERSION_MISMATCH || +- (ret = dbenv->open(dbenv, home, ++ (ret = (dbenv->open)(dbenv, home, + DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; +@@ -544,7 +544,7 @@ open_rep_db(dbenv, dbpp, dbcp) + + dbp = *dbpp; + if ((ret = +- dbp->open(dbp, NULL, REPDBNAME, NULL, DB_BTREE, 0, 0)) != 0) { ++ (dbp->open)(dbp, NULL, REPDBNAME, NULL, DB_BTREE, 0, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open"); + goto err; + } +--- db-4.6.18/hsearch/hsearch.c.glibc 2007-05-17 17:15:39.000000000 +0200 ++++ db-4.6.18/hsearch/hsearch.c 2007-08-06 15:26:11.000000000 +0200 +@@ -75,7 +75,7 @@ __db_hcreate(nel) + if ((ret = dbp->set_pagesize(dbp, 512)) != 0 || + (ret = dbp->set_h_ffactor(dbp, 16)) != 0 || + (ret = dbp->set_h_nelem(dbp, (u_int32_t)nel)) != 0 || +- (ret = dbp->open(dbp, NULL, ++ (ret = (dbp->open)(dbp, NULL, + NULL, NULL, DB_HASH, DB_CREATE, __db_omode(OWNER_RW))) != 0) + __os_set_errno(ret); + +--- db-4.6.18/db_recover/db_recover.c.glibc 2007-05-17 17:15:03.000000000 +0200 ++++ db-4.6.18/db_recover/db_recover.c 2007-08-06 15:26:11.000000000 +0200 +@@ -138,7 +138,7 @@ main(argc, argv) + DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON); + LF_SET(fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER); + LF_SET(retain_env ? DB_INIT_LOCK : DB_PRIVATE); +- if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) { ++ if ((ret = (dbenv->open)(dbenv, home, flags, 0)) != 0) { + dbenv->err(dbenv, ret, "DB_ENV->open"); + goto shutdown; + } +--- db-4.6.18/db185/db185.c.glibc 2007-05-17 17:14:57.000000000 +0200 ++++ db-4.6.18/db185/db185.c 2007-08-06 15:37:39.000000000 +0200 +@@ -227,7 +227,7 @@ __db185_open(file, oflags, mode, type, o + dbp->api_internal = db185p; + + /* Open the database. */ +- if ((ret = dbp->open(dbp, NULL, ++ if ((ret = (dbp->open)(dbp, NULL, + file, NULL, type, __db_oflags(oflags), mode)) != 0) + goto err; + +--- db-4.6.18/db_stat/db_stat.c.glibc 2007-07-06 17:43:57.000000000 +0200 ++++ db-4.6.18/db_stat/db_stat.c 2007-08-06 15:26:11.000000000 +0200 +@@ -282,9 +282,9 @@ retry: if ((ret = db_env_create(&dbenv, + * hash databases for which we don't know the hash function). + */ + dbenv->set_errfile(dbenv, NULL); +- ret = dbp->open(dbp, NULL, db, subdb, DB_UNKNOWN, 0, 0); ++ ret = (dbp->open)(dbp, NULL, db, subdb, DB_UNKNOWN, 0, 0); + dbenv->set_errfile(dbenv, stderr); +- if (ret != 0 && (ret = dbp->open( ++ if (ret != 0 && (ret = (dbp->open)( + dbp, NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { + dbenv->err(dbenv, ret, "DB->open: %s", db); + goto err; +@@ -392,7 +392,7 @@ db_init(dbenv, home, ttype, cache, is_pr + * error, I think. + */ + *is_private = 0; +- if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) == 0) ++ if ((ret = (dbenv->open)(dbenv, home, DB_USE_ENVIRON, 0)) == 0) + return (0); + if (ret == DB_VERSION_MISMATCH) + goto err; +@@ -422,7 +422,7 @@ db_init(dbenv, home, ttype, cache, is_pr + oflags |= DB_INIT_MPOOL; + if (ttype == T_LOG) + oflags |= DB_INIT_LOG; +- if ((ret = dbenv->open(dbenv, home, oflags, 0)) == 0) ++ if ((ret = (dbenv->open)(dbenv, home, oflags, 0)) == 0) + return (0); + + /* An environment is required. */ +--- db-4.6.18/db_verify/db_verify.c.glibc 2007-05-17 17:15:05.000000000 +0200 ++++ db-4.6.18/db_verify/db_verify.c 2007-08-06 15:26:11.000000000 +0200 +@@ -129,7 +129,7 @@ retry: if ((ret = db_env_create(&dbenv, + */ + private = 0; + if ((ret = +- dbenv->open(dbenv, home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0) { ++ (dbenv->open)(dbenv, home, DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0) { + if (ret != DB_VERSION_MISMATCH) { + if ((ret = + dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) { +@@ -137,7 +137,7 @@ retry: if ((ret = db_env_create(&dbenv, + goto shutdown; + } + private = 1; +- ret = dbenv->open(dbenv, home, DB_CREATE | ++ ret = (dbenv->open)(dbenv, home, DB_CREATE | + DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0); + } + if (ret != 0) { +@@ -186,7 +186,7 @@ retry: if ((ret = db_env_create(&dbenv, + goto shutdown; + } + +- ret = dbp1->open(dbp1, ++ ret = (dbp1->open)(dbp1, + NULL, argv[0], NULL, DB_UNKNOWN, DB_RDONLY, 0); + + /* +--- db-4.6.18/db_load/db_load.c.glibc 2007-05-17 19:17:42.000000000 +0200 ++++ db-4.6.18/db_load/db_load.c 2007-08-06 15:26:11.000000000 +0200 +@@ -394,7 +394,7 @@ retry_db: + #endif + + /* Open the DB file. */ +- if ((ret = dbp->open(dbp, NULL, name, subdb, dbtype, ++ if ((ret = (dbp->open)(dbp, NULL, name, subdb, dbtype, + DB_CREATE | (TXN_ON(dbenv) ? DB_AUTO_COMMIT : 0), + __db_omode("rw-rw-rw-"))) != 0) { + dbp->err(dbp, ret, "DB->open: %s", name); +@@ -608,7 +608,7 @@ db_init(dbenv, home, cache, is_private) + /* We may be loading into a live environment. Try and join. */ + flags = DB_USE_ENVIRON | + DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN; +- if ((ret = dbenv->open(dbenv, home, flags, 0)) == 0) ++ if ((ret = (dbenv->open)(dbenv, home, flags, 0)) == 0) + return (0); + if (ret == DB_VERSION_MISMATCH) + goto err; +@@ -632,7 +632,7 @@ db_init(dbenv, home, cache, is_private) + dbenv->err(dbenv, ret, "set_cachesize"); + return (1); + } +- if ((ret = dbenv->open(dbenv, home, flags, 0)) == 0) ++ if ((ret = (dbenv->open)(dbenv, home, flags, 0)) == 0) + return (0); + + /* An environment is required. */ +--- db-4.6.18/xa/xa_db.c.glibc 2007-05-17 17:16:00.000000000 +0200 ++++ db-4.6.18/xa/xa_db.c 2007-08-06 15:49:57.000000000 +0200 +@@ -131,7 +131,7 @@ __xa_open(dbp, txn, name, subdb, type, f + if ((ret = + __xa_set_txn(dbp, &txn, LF_ISSET(DB_AUTO_COMMIT) ? 1 : 0)) != 0) + return (ret); +- if ((ret = xam->open(dbp, txn, name, subdb, type, flags, mode)) != 0) ++ if ((ret = (xam->open)(dbp, txn, name, subdb, type, flags, mode)) != 0) + return (ret); + + /* Wrap any DB handle method that takes a TXN ID as an argument. */ +--- db-4.6.18/xa/xa.c.glibc 2007-06-29 02:25:02.000000000 +0200 ++++ db-4.6.18/xa/xa.c 2007-08-06 15:43:44.000000000 +0200 +@@ -206,7 +206,7 @@ __db_xa_open(xa_info, rmid, arg_flags) + /* Open a new environment. */ + if (db_env_create(&dbenv, 0) != 0) + return (XAER_RMERR); +- if (dbenv->open(dbenv, xa_info, XA_FLAGS, 0) != 0) ++ if ((dbenv->open)(dbenv, xa_info, XA_FLAGS, 0) != 0) + goto err; + + /* Create the mapping. */ diff --git a/openldap-2.3.37-fortify-open.patch b/openldap-2.3.37-fortify-open.patch new file mode 100644 index 0000000..1fe7370 --- /dev/null +++ b/openldap-2.3.37-fortify-open.patch @@ -0,0 +1,61 @@ +--- openldap-2.3.37/servers/slapd/back-ldbm/ldbm.c.orig 2007-01-02 16:44:03.000000000 -0500 ++++ openldap-2.3.37/servers/slapd/back-ldbm/ldbm.c 2007-08-06 05:23:44.000000000 -0400 +@@ -298,10 +298,10 @@ DB_ENV *ldbm_initialize_env(const char * + home = n2; + #endif + #if DB_VERSION_X >= 0x030100 +- err = env->open( env, home, envFlags, 0 ); ++ err = (env->open)( env, home, envFlags, 0 ); + #else + /* 3.0.x requires an extra argument */ +- err = env->open( env, home, NULL, envFlags, 0 ); ++ err = (env->open)( env, home, NULL, envFlags, 0 ); + #endif + + if ( err != 0 ) { +@@ -380,9 +380,9 @@ ldbm_open( DB_ENV *env, char *name, int + name = n2; + #endif + #if DB_VERSION_X >= 0x040111 +- err = ret->open( ret, NULL, name, NULL, DB_TYPE, rw, mode); ++ err = (ret->open)( ret, NULL, name, NULL, DB_TYPE, rw, mode); + #else +- err = ret->open( ret, name, NULL, DB_TYPE, rw, mode); ++ err = (ret->open)( ret, name, NULL, DB_TYPE, rw, mode); + #endif + + if ( err != 0 ) { +--- openldap-2.3.37/servers/slapd/back-bdb/back-bdb.h.orig 2007-01-03 05:36:04.000000000 +0100 ++++ openldap-2.3.37/servers/slapd/back-bdb/back-bdb.h 2007-08-06 12:26:17.000000000 +0200 +@@ -226,7 +226,7 @@ struct bdb_op_info { + }; + + #define DB_OPEN(db, file, name, type, flags, mode) \ +- (db)->open(db, file, name, type, flags, mode) ++ ((db)->open)(db, file, name, type, flags, mode) + + #if DB_VERSION_MAJOR < 4 + #define LOCK_DETECT(env,f,t,a) lock_detect(env, f, t, a) +@@ -257,7 +257,7 @@ struct bdb_op_info { + #if DB_VERSION_FULL >= 0x04010011 + #undef DB_OPEN + #define DB_OPEN(db, file, name, type, flags, mode) \ +- (db)->open(db, NULL, file, name, type, flags, mode) ++ ((db)->open)(db, NULL, file, name, type, flags, mode) + #endif + + #endif +--- openldap-2.3.37/build/openldap.m4.orig 2007-02-13 05:35:39.000000000 +0100 ++++ openldap-2.3.37/build/openldap.m4 2007-08-06 12:27:58.000000000 +0200 +@@ -627,9 +627,9 @@ main() + } + + #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) +- rc = env->open( env, NULL, flags, 0 ); ++ rc = (env->open)( env, NULL, flags, 0 ); + #else +- rc = env->open( env, NULL, NULL, flags, 0 ); ++ rc = (env->open)( env, NULL, NULL, flags, 0 ); + #endif + + if ( rc == 0 ) { diff --git a/openldap.spec b/openldap.spec index df4eb31..083eeea 100644 --- a/openldap.spec +++ b/openldap.spec @@ -37,6 +37,7 @@ Patch6: openldap-2.3.19-gethostbyXXXX_r.patch Patch7: openldap-2.3.34-quiet-slaptest.patch Patch8: openldap-2.3.34-pthread.patch Patch9: openldap-2.3.37-smbk5pwd.patch +Patch10: openldap-2.3.37-fortify-open.patch # Patches for 2.2.29 for the compat-openldap package. Patch100: openldap-2.2.13-tls-fix-connection-test.patch @@ -59,6 +60,7 @@ Patch307: MigrationTools-46-unique-hosts.patch # Patches for db4 library Patch400: db-4.3.29-sparc64.patch Patch401: db-4.5.20-jni-include-dir.patch +Patch402: db-4.6.18-glibc.patch URL: http://www.openldap.org/ BuildRoot: %{_tmppath}/%{name}-%{version_23}-root @@ -92,6 +94,8 @@ customized LDAP clients. %package servers Summary: OpenLDAP servers and related files. +# OpenLDAP server includes Berkeley DB library, which is licensed under Sleepycat and BSD licenses) +License: OpenLDAP and (Sleepycat and BSD) Requires: fileutils, make, openldap = %{version_23}-%{release}, openssl, /usr/sbin/useradd, /sbin/chkconfig, /sbin/runuser Group: System Environment/Daemons @@ -156,6 +160,7 @@ required by some applications. pushd db-%{db_version} %patch400 -p1 -b .sparc64 %patch401 -p1 -b .4.5.20.jni +%patch402 -p1 -b .glibc popd pushd openldap-%{version_23} @@ -169,6 +174,7 @@ pushd openldap-%{version_23} %patch7 -p1 -b .quiet-slaptest %patch8 -p1 -b .pthread %patch9 -p1 -b .smbk5pwd +%patch10 -p1 -b .fortify-open cp %{_datadir}/libtool/config.{sub,guess} build/ popd @@ -381,6 +387,10 @@ install -d $RPM_BUILD_ROOT/%{_libdir}/ install -m755 libslapd_db-*.*.so $RPM_BUILD_ROOT/%{_libdir}/ popd +pushd db-%{db_version} +mv LICENSE LICENSE.bdb-backend +popd + pushd openldap-%{version_23}/build-servers make install DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} LIBTOOL="$libtool" STRIP="" popd @@ -602,6 +612,7 @@ fi %defattr(-,root,root) %doc README.migration %doc TOOLS.migration +%doc db-%{db_version}/LICENSE.bdb-backend %doc $RPM_SOURCE_DIR/README.upgrading $RPM_SOURCE_DIR/guide.html %doc openldap-%{version_23}/contrib/slapd-modules/smbk5pwd/README.smbk5pwd %ghost %config %{_sysconfdir}/pki/tls/certs/slapd.pem @@ -664,6 +675,7 @@ fi - do not distinguish between NPTL and non-NPTL platforms, we have NPTL everywhere - db-4.6.18 integrated +- updated openldap-servers License: field to reference BDB license * Tue Jul 31 2007 Jan Safranek 2.3.37-1%{?dist} - new upstream version diff --git a/sources b/sources index 9ab81d5..d53d6ad 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ 6c4c72a1336aa45b463e738034c078d6 openldap-2.2.29.tgz 3faf83eb8482e55979bda47f1d1e6501 MigrationTools-47.tar.gz -33851f01b455cca48aa601956de93c6f db-4.4.20.tar.gz f5c6cec07469ce8f64710eba3aeb58f8 openldap-2.3.37.tgz +95768bd92fd48951a427fbab37b9088f db-4.6.18.tar.gz