Quellcode durchsuchen

Ticket #257 - repl-monitor doesn't work if leftmost hostnames are the same

https://fedorahosted.org/389/ticket/257
Resolves: Ticket #257
Bug Description: repl-monitor doesn't work if leftmost hostnames are the same
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Match on the fqdn instead of just the hostname.  Verified
that it works correctly in such an environment.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson vor 14 Jahren
Ursprung
Commit
165518b6ed
1 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 5 5
      ldap/admin/src/scripts/repl-monitor.pl.in

+ 5 - 5
ldap/admin/src/scripts/repl-monitor.pl.in

@@ -836,6 +836,11 @@ sub add_server
 	my ($domainpattern) = '\.[^:]+';
 	my ($i);
 
+	for ($i = 0; $i <= $#servers; $i++) {
+		return $i if ($servers[$i] =~ /$host:\d*=$shadowport\D/i);
+		return $i if ($servers[$i] =~ /$host:$port\D/i);
+	}
+
 	# Remove the domain name from the host name
 	my ($hostnode) = $host;
 	$hostnode = $1 if $host =~ /^(.+?)\./;
@@ -872,11 +877,6 @@ sub add_server
 		$bindcert = $c if ($bindcert eq "" || $bindcert eq "*");
 	}
 
-	for ($i = 0; $i <= $#servers; $i++) {
-		return $i if ($servers[$i] =~ /$hostnode($domainpattern)*:\d*=$shadowport\D/i);
-		return $i if ($servers[$i] =~ /$hostnode($domainpattern)*:$port\D/i);
-	}
-
 	if ($shadowport) {
 		push (@servers, "$host:$port=$shadowport:$binddn:$bindpwd:$bindcert");
 	} else {