s3:idmap_tdb: prevent opening the idmap db more than once.
authorMichael Adam <obnox@samba.org>
Thu, 17 Jun 2010 07:35:52 +0000 (09:35 +0200)
committerMichael Adam <obnox@samba.org>
Sat, 14 Aug 2010 00:10:52 +0000 (02:10 +0200)
source3/winbindd/idmap_tdb.c

index 86bb018bb0c20f202151eb2766aae1d7a1a66e2d..8bb615d8f8ddcdb3c8b72200ba397076a6a3dcbe 100644 (file)
@@ -268,6 +268,11 @@ static NTSTATUS idmap_tdb_open_db(struct idmap_domain *dom)
 
        ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
 
+       if (ctx->db) {
+               /* it is already open */
+               return NT_STATUS_OK;
+       }
+
        /* use our own context here */
        mem_ctx = talloc_stackframe();