From 3f43b262b1c5b9841fd0f387cac442aefeb84da9 Mon Sep 17 00:00:00 2001
From: Radovan Sroka <rsroka@redhat.com>
Date: Sun, 31 Jan 2021 18:49:10 +0100
Subject: [PATCH] Added MDB_NOLOCK to cli mdb_env_open() (#114)
- MDB_NOLOCK option resolves the issue with --dump-db hang
Signed-off-by: Radovan Sroka <rsroka@redhat.com>
---
src/cli/fapolicyd-cli.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cli/fapolicyd-cli.c b/src/cli/fapolicyd-cli.c
index fe47948..befb8ce 100644
--- a/src/cli/fapolicyd-cli.c
+++ b/src/cli/fapolicyd-cli.c
@@ -114,7 +114,7 @@ static int do_dump_db(void)
return 1;
}
mdb_env_set_maxdbs(env, 2);
- rc = mdb_env_open(env, DB_DIR, MDB_RDONLY, 0660);
+ rc = mdb_env_open(env, DB_DIR, MDB_RDONLY|MDB_NOLOCK, 0660);
if (rc) {
fprintf(stderr, "mdb_env_open failed, error %d %s\n", rc,
mdb_strerror(rc));