andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 6 months ago
Clone
dc8c34
From 9008f4ff5ca727a9ab712b5d838000f129a08180 Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Tue, 5 Aug 2014 10:53:03 -0400
dc8c34
Subject: [PATCH 238/243] Ticket 47862 - Repl-monitor.pl ignores the provided
dc8c34
 connection parameters
dc8c34
dc8c34
Bug Description:  The orignal fix for ticket 47538 was not correctly
dc8c34
                  ported to earlier branches (1.3.2. and down)
dc8c34
dc8c34
Fix Description:  Added the missing "set_server_params" function.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47862
dc8c34
dc8c34
Reviewed by: nhosoi(Thanks!)
dc8c34
dc8c34
(cherry picked from commit 7c5d8f2d31d804d516f0ff1cc85d381303582a2d)
dc8c34
(cherry picked from commit c6ad00b236e748470345726dfc18dc5e240159f8)
dc8c34
---
dc8c34
 ldap/admin/src/scripts/repl-monitor.pl.in | 27 +++++++++++++++++++++++++++
dc8c34
 1 file changed, 27 insertions(+)
dc8c34
dc8c34
diff --git a/ldap/admin/src/scripts/repl-monitor.pl.in b/ldap/admin/src/scripts/repl-monitor.pl.in
dc8c34
index 45d58a1..9107c2d 100755
dc8c34
--- a/ldap/admin/src/scripts/repl-monitor.pl.in
dc8c34
+++ b/ldap/admin/src/scripts/repl-monitor.pl.in
dc8c34
@@ -281,6 +281,7 @@ $prompt = "";
dc8c34
 
dc8c34
 	# Start with the given host and port
dc8c34
 	# The index names in %ld are defined in Mozilla::LDAP::Utils::ldapArgs()
dc8c34
+	&set_server_params();
dc8c34
 	&add_server ("$ld{host}:$ld{port}:$ld{bind}:$ld{pswd}:$ld{cert}");
dc8c34
 
dc8c34
 	$serveridx = 0;
dc8c34
@@ -325,6 +326,32 @@ sub validateArgs
dc8c34
 	return $rc;
dc8c34
 }
dc8c34
 
dc8c34
+sub set_server_params
dc8c34
+{
dc8c34
+    my ($host, $port, $binddn, $bindpwd, $bindcert);
dc8c34
+    
dc8c34
+    ($host, $port, $binddn, $bindpwd, $bindcert) = split (/:/, $allconnections[0]);
dc8c34
+    if($opt_p && $opt_p ne ""){
dc8c34
+        $ld{port} = $opt_p
dc8c34
+    } elsif(!$port || $port eq ""){
dc8c34
+        $ld{port} = "389";
dc8c34
+    } else {
dc8c34
+        $ld{port} = $port;
dc8c34
+    }
dc8c34
+    if($host && $host ne ""){
dc8c34
+        $ld{host} = $host;
dc8c34
+    }
dc8c34
+    if($binddn){
dc8c34
+        $ld{bind} = $binddn;
dc8c34
+    }
dc8c34
+    if($bindpwd){
dc8c34
+        $ld{pswd} = $bindpwd;
dc8c34
+    }
dc8c34
+    if($bindcert){
dc8c34
+        $ld{cert} = $bindcert;
dc8c34
+    }
dc8c34
+}
dc8c34
+
dc8c34
 sub read_cfg_file
dc8c34
 {
dc8c34
 	($fn) = @_;
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34