From 08cdca32577a9521aa5e4f06bb6754d1840e9675 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 31 Mar 2010 01:55:06 +0300 Subject: [PATCH] Remove "truncate" BDB config option - Truncate is so dangerous that dbiOpenDB() discarded it even if set in configuration. How useful is that? --- lib/backend/db3.c | 4 ---- lib/backend/dbconfig.c | 2 -- 2 files changed, 6 deletions(-) diff --git a/lib/backend/db3.c b/lib/backend/db3.c index 05d8b58..29eb345 100644 --- a/lib/backend/db3.c +++ b/lib/backend/db3.c @@ -501,7 +501,6 @@ int dbiOpenDB(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) return 1; oflags = (dbi->dbi_oeflags | dbi->dbi_oflags); - oflags &= ~DB_TRUNCATE; /* XXX this is dangerous */ #if 0 /* XXX rpmdb: illegal flag combination specified to DB->open */ if ( dbi->dbi_mode & O_EXCL) oflags |= DB_EXCL; @@ -515,9 +514,6 @@ int dbiOpenDB(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) oflags |= DB_CREATE; dbi->dbi_oeflags |= DB_CREATE; } -#ifdef DANGEROUS - if ( dbi->dbi_mode & O_TRUNC) oflags |= DB_TRUNCATE; -#endif /* * Avoid incompatible DB_CREATE/DB_RDONLY flags on DBENV->open. diff --git a/lib/backend/dbconfig.c b/lib/backend/dbconfig.c index 9a788f9..474d5ae 100644 --- a/lib/backend/dbconfig.c +++ b/lib/backend/dbconfig.c @@ -64,8 +64,6 @@ static const struct poptOption rdbOptions[] = { NULL, NULL }, { "rdonly", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_RDONLY, NULL, NULL }, - { "truncate", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_TRUNCATE, - NULL, NULL }, { "fcntl_locking",0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_FCNTL_LOCKING, NULL, NULL }, -- 2.7.4