Remove "truncate" BDB config option
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 30 Mar 2010 22:55:06 +0000 (01:55 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 30 Mar 2010 22:55:06 +0000 (01:55 +0300)
- Truncate is so dangerous that dbiOpenDB() discarded it even if
  set in configuration. How useful is that?

lib/backend/db3.c
lib/backend/dbconfig.c

index 05d8b58..29eb345 100644 (file)
@@ -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.
index 9a788f9..474d5ae 100644 (file)
@@ -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 },