summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-21 11:00:50 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-21 11:00:50 +0300
commitbaa1cf0e1bdb7260be1cb41dc5e6c3bad180a34e (patch)
tree5d5fef64684a3638e6c0a0e80750295adae9998a
parent510c6763ef745b308abd1cc6cec2a62119e87c9c (diff)
downloadlibrpm-tizen-baa1cf0e1bdb7260be1cb41dc5e6c3bad180a34e.tar.gz
librpm-tizen-baa1cf0e1bdb7260be1cb41dc5e6c3bad180a34e.tar.bz2
librpm-tizen-baa1cf0e1bdb7260be1cb41dc5e6c3bad180a34e.zip
Remove BDB RPC "support"
- it's insecure, used by nobody (its been rather broken for a long time) and all, but BDB 4.8.x removed RPC support from upstream so we cant very well support in the future even if we wanted to
-rwxr-xr-xdb3/configure2
-rw-r--r--lib/backend/db3.c69
-rw-r--r--lib/backend/dbconfig.c20
-rw-r--r--lib/rpmdb_internal.h4
4 files changed, 21 insertions, 74 deletions
diff --git a/db3/configure b/db3/configure
index 0682bc7d3..160b8e801 100755
--- a/db3/configure
+++ b/db3/configure
@@ -11,7 +11,7 @@ rm -f config.cache
ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`"
CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
- --enable-shared --enable-static --enable-rpc \
+ --enable-shared --enable-static \
--with-uniquename=_rpmdb --srcdir=$db_dist
mv Makefile Makefile.orig
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 394d2010b..f6db60aa5 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -19,10 +19,6 @@ static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include "debug.h"
-#if !defined(DB_CLIENT) /* XXX db-4.2.42 retrofit */
-#define DB_CLIENT DB_RPCCLIENT
-#endif
-
static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit)
{
if (printit && error) {
@@ -97,7 +93,7 @@ static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
rpmdb rpmdb = dbi->dbi_rpmdb;
DB_ENV *dbenv = NULL;
int eflags;
- int rc;
+ int rc, xx;
if (dbenvp == NULL)
return 1;
@@ -114,10 +110,6 @@ static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
free(fstr);
}
- /* XXX Can't do RPC w/o host. */
- if (dbi->dbi_host == NULL)
- dbi->dbi_ecflags &= ~DB_CLIENT;
-
/* XXX Set a default shm_key. */
if ((dbi->dbi_eflags & DB_SYSTEM_MEM) && dbi->dbi_shmkey == 0) {
#if defined(HAVE_FTOK)
@@ -132,8 +124,6 @@ static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
if (dbenv == NULL || rc)
goto errxit;
- { int xx;
-
dbenv->set_alloc(dbenv,rpmdb->db_malloc, rpmdb->db_realloc, rpmdb->db_free);
dbenv->set_errcall(dbenv, (void *) rpmdb->db_errcall);
dbenv->set_errfile(dbenv, rpmdb->db_errfile);
@@ -148,44 +138,27 @@ static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
dbenv->set_isalive(dbenv, db3isalive);
#endif
- if ((dbi->dbi_ecflags & DB_CLIENT) && dbi->dbi_host) {
- const char * home;
- int retry = 0;
-
- if ((home = strrchr(dbhome, '/')) != NULL)
- dbhome = ++home;
-
- while (retry++ < 5) {
- xx = dbenv->set_rpc_server(dbenv, NULL, dbi->dbi_host,
- dbi->dbi_cl_timeout, dbi->dbi_sv_timeout, 0);
- xx = cvtdberr(dbi, "dbenv->set_server", xx, _debug);
- if (!xx)
- break;
- (void) sleep(15);
- }
- } else {
#if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
- xx = dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT,
- (dbi->dbi_verbose & DB_VERB_CHKPOINT));
+ dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT,
+ (dbi->dbi_verbose & DB_VERB_CHKPOINT));
#endif
- xx = dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK,
- (dbi->dbi_verbose & DB_VERB_DEADLOCK));
- xx = dbenv->set_verbose(dbenv, DB_VERB_RECOVERY,
- (dbi->dbi_verbose & DB_VERB_RECOVERY));
- xx = dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR,
- (dbi->dbi_verbose & DB_VERB_WAITSFOR));
-
- if (dbi->dbi_mmapsize) {
- xx = dbenv->set_mp_mmapsize(dbenv, dbi->dbi_mmapsize);
- xx = cvtdberr(dbi, "dbenv->set_mp_mmapsize", xx, _debug);
- }
- if (dbi->dbi_tmpdir) {
- const char * root = rpmdb->db_chrootDone ? NULL : rpmdb->db_root;
- char * tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL);
- xx = dbenv->set_tmp_dir(dbenv, tmpdir);
- xx = cvtdberr(dbi, "dbenv->set_tmp_dir", xx, _debug);
- tmpdir = _free(tmpdir);
- }
+ dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK,
+ (dbi->dbi_verbose & DB_VERB_DEADLOCK));
+ dbenv->set_verbose(dbenv, DB_VERB_RECOVERY,
+ (dbi->dbi_verbose & DB_VERB_RECOVERY));
+ dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR,
+ (dbi->dbi_verbose & DB_VERB_WAITSFOR));
+
+ if (dbi->dbi_mmapsize) {
+ xx = dbenv->set_mp_mmapsize(dbenv, dbi->dbi_mmapsize);
+ xx = cvtdberr(dbi, "dbenv->set_mp_mmapsize", xx, _debug);
+ }
+ if (dbi->dbi_tmpdir) {
+ const char * root = rpmdb->db_chrootDone ? NULL : rpmdb->db_root;
+ char * tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL);
+ xx = dbenv->set_tmp_dir(dbenv, tmpdir);
+ xx = cvtdberr(dbi, "dbenv->set_tmp_dir", xx, _debug);
+ tmpdir = _free(tmpdir);
}
if (dbi->dbi_cachesize) {
@@ -202,7 +175,6 @@ static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
xx = dbenv->set_shm_key(dbenv, dbi->dbi_shmkey);
xx = cvtdberr(dbi, "dbenv->set_shm_key", xx, _debug);
}
- }
rc = (dbenv->open)(dbenv, dbhome, eflags, dbi->dbi_perms);
rc = cvtdberr(dbi, "dbenv->open", rc, _debug);
@@ -839,7 +811,6 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
* glibc/kernel combinations.
*/
if (rc == 0 && dbi->dbi_lockdbfd &&
- !((dbi->dbi_ecflags & DB_CLIENT) && dbi->dbi_host) &&
(!dbi->dbi_use_dbenv || _lockdbfd++ == 0))
{
int fdno = -1;
diff --git a/lib/backend/dbconfig.c b/lib/backend/dbconfig.c
index 9bbef1c0a..074166d1c 100644
--- a/lib/backend/dbconfig.c
+++ b/lib/backend/dbconfig.c
@@ -29,16 +29,6 @@ static int dbi_tear_down;
*/
struct poptOption rdbOptions[] = {
/* XXX DB_CXX_NO_EXCEPTIONS */
-#if defined(DB_CLIENT)
- { "client", 0,POPT_BIT_SET, &db3dbi.dbi_ecflags, DB_CLIENT,
- NULL, NULL },
-#endif
-#if defined(DB_RPCCLIENT)
- { "client", 0,POPT_BIT_SET, &db3dbi.dbi_ecflags, DB_RPCCLIENT,
- NULL, NULL },
- { "rpcclient", 0,POPT_BIT_SET, &db3dbi.dbi_ecflags, DB_RPCCLIENT,
- NULL, NULL },
-#endif
{ "create", 0,POPT_BIT_SET, &db3dbi.dbi_oeflags, DB_CREATE,
NULL, NULL },
@@ -116,15 +106,6 @@ struct poptOption rdbOptions[] = {
{ "tmpdir", 0,POPT_ARG_STRING, &db3dbi.dbi_tmpdir, 0,
NULL, NULL },
- { "host", 0,POPT_ARG_STRING, &db3dbi.dbi_host, 0,
- NULL, NULL },
- { "server", 0,POPT_ARG_STRING, &db3dbi.dbi_host, 0,
- NULL, NULL },
- { "cl_timeout", 0,POPT_ARG_LONG, &db3dbi.dbi_cl_timeout, 0,
- NULL, NULL },
- { "sv_timeout", 0,POPT_ARG_LONG, &db3dbi.dbi_sv_timeout, 0,
- NULL, NULL },
-
{ "verify", 0,POPT_ARG_NONE, &db3dbi.dbi_verify_on_close, 0,
NULL, NULL },
{ "teardown", 0,POPT_ARG_NONE, &dbi_tear_down, 0,
@@ -244,7 +225,6 @@ dbiIndex db3Free(dbiIndex dbi)
dbi->dbi_file = _free(dbi->dbi_file);
dbi->dbi_subfile = _free(dbi->dbi_subfile);
dbi->dbi_tmpdir = _free(dbi->dbi_tmpdir);
- dbi->dbi_host = _free(dbi->dbi_host);
dbi->dbi_errpfx = _free(dbi->dbi_errpfx);
dbi->dbi_re_source = _free(dbi->dbi_re_source);
dbi->dbi_stats = _free(dbi->dbi_stats);
diff --git a/lib/rpmdb_internal.h b/lib/rpmdb_internal.h
index 1318303f0..07391bea1 100644
--- a/lib/rpmdb_internal.h
+++ b/lib/rpmdb_internal.h
@@ -188,10 +188,6 @@ struct _dbiIndex {
int dbi_debug;
int dbi_byteswapped;
- char * dbi_host;
- unsigned long dbi_cl_timeout;
- unsigned long dbi_sv_timeout;
-
/* dbenv parameters */
int dbi_lorder;
/* XXX db-4.3.14 adds dbenv as 1st arg. */