From 7c5d8f2d31d804d516f0ff1cc85d381303582a2d Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Aug 05 2014 18:40:49 +0000 Subject: Ticket 47862 - Repl-monitor.pl ignores the provided connection parameters Bug Description: The orignal fix for ticket 47538 was not correctly ported to earlier branches (1.3.2. and down) Fix Description: Added the missing "set_server_params" function. https://fedorahosted.org/389/ticket/47862 Reviewed by: nhosoi(Thanks!) --- diff --git a/ldap/admin/src/scripts/repl-monitor.pl.in b/ldap/admin/src/scripts/repl-monitor.pl.in index 45d58a1..9107c2d 100755 --- a/ldap/admin/src/scripts/repl-monitor.pl.in +++ b/ldap/admin/src/scripts/repl-monitor.pl.in @@ -281,6 +281,7 @@ $prompt = ""; # Start with the given host and port # The index names in %ld are defined in Mozilla::LDAP::Utils::ldapArgs() + &set_server_params(); &add_server ("$ld{host}:$ld{port}:$ld{bind}:$ld{pswd}:$ld{cert}"); $serveridx = 0; @@ -325,6 +326,32 @@ sub validateArgs return $rc; } +sub set_server_params +{ + my ($host, $port, $binddn, $bindpwd, $bindcert); + + ($host, $port, $binddn, $bindpwd, $bindcert) = split (/:/, $allconnections[0]); + if($opt_p && $opt_p ne ""){ + $ld{port} = $opt_p + } elsif(!$port || $port eq ""){ + $ld{port} = "389"; + } else { + $ld{port} = $port; + } + if($host && $host ne ""){ + $ld{host} = $host; + } + if($binddn){ + $ld{bind} = $binddn; + } + if($bindpwd){ + $ld{pswd} = $bindpwd; + } + if($bindcert){ + $ld{cert} = $bindcert; + } +} + sub read_cfg_file { ($fn) = @_;