[New-bugs-announce] [issue17347] bsddb._openDBEnv() should not touch current directory

Florian Weimer report at bugs.python.org
Mon Mar 4 11:47:56 CET 2013


New submission from Florian Weimer:

This code:

def _openDBEnv(cachesize):
    e = db.DBEnv()
    if cachesize is not None:
        if cachesize >= 20480:
            e.set_cachesize(0, cachesize)
        else:
            raise error, "cachesize must be >= 20480"
    e.set_lk_detect(db.DB_LOCK_DEFAULT)
    e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL)
    return e

causes Berkeley DB to read the DB_CONFIG file from the current directory, which may have unexpected side effects.  Unfortunately, Berkeley DB still reads ./DB_CONFIG even if the first argument to DBEnv.open() is None/NULL, so the only way to suppress this behavior seems a non-existing or known-to-by-empty directory (such as "/var/empty").

----------
components: Extension Modules
messages: 183430
nosy: fweimer
priority: normal
severity: normal
status: open
title: bsddb._openDBEnv() should not touch current directory
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17347>
_______________________________________


More information about the New-bugs-announce mailing list