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