Browse Source

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!)
Mark Reynolds 8 years ago
parent
commit
4b41a02484
1 changed files with 4 additions and 0 deletions
  1. 4 0
      ldap/admin/src/scripts/repl-monitor.pl.in

+ 4 - 0
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 "*"   ||