From: Remi Gacogne Date: Wed, 23 Jun 2021 13:52:36 +0000 (+0200) Subject: dnsdist: Open the LMDB database as read-only since we never update it X-Git-Tag: dnsdist-1.7.0-alpha1~87^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db190fa2c3e897a7966036779be6919d22c8e26f;p=thirdparty%2Fpdns.git dnsdist: Open the LMDB database as read-only since we never update it That also prevents creating it by mistake. --- diff --git a/pdns/dnsdistdist/dnsdist-kvs.hh b/pdns/dnsdistdist/dnsdist-kvs.hh index 939be8a4da..d75972b367 100644 --- a/pdns/dnsdistdist/dnsdist-kvs.hh +++ b/pdns/dnsdistdist/dnsdist-kvs.hh @@ -165,7 +165,7 @@ public: class LMDBKVStore: public KeyValueStore { public: - LMDBKVStore(const std::string& fname, const std::string& dbName): d_env(fname.c_str(), MDB_NOSUBDIR, 0600), d_dbi(d_env.openDB(dbName, 0)), d_fname(fname), d_dbName(dbName) + LMDBKVStore(const std::string& fname, const std::string& dbName): d_env(fname.c_str(), MDB_NOSUBDIR|MDB_RDONLY, 0600), d_dbi(d_env.openDB(dbName, 0)), d_fname(fname), d_dbName(dbName) { }