From db190fa2c3e897a7966036779be6919d22c8e26f Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 23 Jun 2021 15:52:36 +0200 Subject: [PATCH] dnsdist: Open the LMDB database as read-only since we never update it That also prevents creating it by mistake. --- pdns/dnsdistdist/dnsdist-kvs.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { } -- 2.47.2