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