ldb_mdb: prevent MDB_env reuse across forks
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 13 Mar 2018 02:08:10 +0000 (15:08 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 23 May 2018 00:27:11 +0000 (02:27 +0200)
commit322e42818b144249084dc3a8d4f7988cd8fcab3e
treea256331c2c474ee11becc5c4f447dbea5b541914
parent14f5c7522caa0006837658a156f090d8dd65bb0d
ldb_mdb: prevent MDB_env reuse across forks

MDB_env's may not be reused accross forks.  Check the pid that the lmdb
structure was created by, and return an error if it is being used by a
different process.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/ldb_mdb/ldb_mdb.c