slapi-nis/slapi-nis-bz1832190.patch
2020-05-06 14:50:08 +03:00

50 lines
1.3 KiB
Diff

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