amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone
Blob Blame History Raw
From 80631ee86fa951f18ed25f61ca72734931eb5387 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 2 Oct 2017 16:19:47 -0400
Subject: [PATCH] Ticket 49388 - repl-monitor - matches null string many times
 in regex

Bug Description:  When using a wildcard(*) for the hostname, some of the
                  regex's for parsing the various configurations throws
                  out warnings.

Fix Description:  When a wildcard is detected reset the hostnode variable
                  to nothing.

https://pagure.io/389-ds-base/issue/49388

Reviewed by: firstyear(Thanks!)

(cherry picked from commit 4b41a02484db645a593b9d6ac6c4e062dd374395)
---
 ldap/admin/src/scripts/repl-monitor.pl.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ldap/admin/src/scripts/repl-monitor.pl.in b/ldap/admin/src/scripts/repl-monitor.pl.in
index a3efa8e6e..97c1462a5 100755
--- a/ldap/admin/src/scripts/repl-monitor.pl.in
+++ b/ldap/admin/src/scripts/repl-monitor.pl.in
@@ -1053,6 +1053,10 @@ sub add_server
 	# Remove the domain name from the host name
 	my ($hostnode) = $host;
 	$hostnode = $1 if $host =~ /^(.+?)\./;
+	if ($hostnode eq "*") {
+		# handle wild card correctly for regex
+		$hostnode = "";
+	}
 
 	# new host:port
 	if (!$binddn   || $binddn eq ""   || $binddn eq "*"   ||
-- 
2.13.6