c17375
From e8c3ed416a442f5a431ca48f7ea384a6abc1fa53 Mon Sep 17 00:00:00 2001
c17375
From: Alexander Bokovoy <abokovoy@redhat.com>
c17375
Date: Wed, 6 May 2020 14:08:41 +0300
c17375
Subject: [PATCH] Initialize map lock in NIS plugin as well
c17375
c17375
Also if ignored_containers_sdn is NULL, we don't really need to check
c17375
whether a write could be ignored. It has to be processed, so bail out
c17375
early with FALSE.
c17375
c17375
Resolves: rhbz#1832331
c17375
c17375
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
c17375
---
c17375
 src/back-shr.c | 4 ++++
c17375
 src/plug-nis.c | 3 +++
c17375
 2 files changed, 7 insertions(+)
c17375
c17375
diff --git a/src/back-shr.c b/src/back-shr.c
c17375
index e2b5dd3..c6a181e 100644
c17375
--- a/src/back-shr.c
c17375
+++ b/src/back-shr.c
c17375
@@ -2960,6 +2960,10 @@ backend_shr_write_ignore(Slapi_PBlock *pb)
c17375
     int i = 0;
c17375
     PRBool ignore = PR_FALSE;
c17375
 
c17375
+    if (ignored_containers_sdn == NULL) {
c17375
+        return ignore;
c17375
+    }
c17375
+
c17375
     /* Check if the target DN is a subordinates of
c17375
      * on of the ignored containers
c17375
      */
c17375
diff --git a/src/plug-nis.c b/src/plug-nis.c
c17375
index ee90c37..0ce4ae6 100644
c17375
--- a/src/plug-nis.c
c17375
+++ b/src/plug-nis.c
c17375
@@ -540,6 +540,9 @@ nis_plugin_init(Slapi_PBlock *pb)
c17375
 				"error setting up plugin\n");
c17375
 		return -1;
c17375
 	}
c17375
+
c17375
+	init_map_lock();
c17375
+
c17375
 	/* Read global configuration. */
c17375
 	if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY,
c17375
 			      &plugin_entry) == 0) &&
c17375
-- 
c17375
2.25.4
c17375