From 1d5e1d194e8f2ae5b609f17a38d8adf3043ac864 Mon Sep 17 00:00:00 2001 From: vakwetu Date: Thu, 27 Jan 2011 19:14:18 +0000 Subject: Bugzilla Bug 606944: convert to openldap - add -x to ldapsearch and ldapmodify git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1786 c9f7a03b-bd48-0410-a16d-cbbf54688b0b --- pki/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi | 1 + pki/base/tps/forms/esc/cgi-bin/sow/cfg.pl | 2 ++ pki/base/tps/forms/esc/cgi-bin/sow/enroll.cgi | 1 + pki/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi | 1 + pki/base/tps/forms/esc/cgi-bin/sow/read.cgi | 1 + pki/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi | 1 + pki/base/tps/lib/perl/PKI/TPS/AdminPanel.pm | 2 +- pki/base/tps/lib/perl/PKI/TPS/AuthDBPanel.pm | 2 +- pki/base/tps/lib/perl/PKI/TPS/DatabasePanel.pm | 10 +++++----- pki/base/tps/setup/create.pl | 4 ++-- 10 files changed, 16 insertions(+), 9 deletions(-) (limited to 'pki/base/tps') diff --git a/pki/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi b/pki/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi index 5adfe14bf..8db2d3e48 100755 --- a/pki/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi +++ b/pki/base/tps/forms/esc/cgi-bin/sow/ajax-list.cgi @@ -45,6 +45,7 @@ sub main() my $tmpfile = "/tmp/ajax-list-$$.txt"; my $cmd = $ldapsearch . " " . + "-x " . "-b \"" . $basedn . "\" " . "-h \"" . $ldapHost . "\" " . "-p \"" . $ldapPort ."\" " . diff --git a/pki/base/tps/forms/esc/cgi-bin/sow/cfg.pl b/pki/base/tps/forms/esc/cgi-bin/sow/cfg.pl index 6aac28b00..6bced3836 100755 --- a/pki/base/tps/forms/esc/cgi-bin/sow/cfg.pl +++ b/pki/base/tps/forms/esc/cgi-bin/sow/cfg.pl @@ -109,6 +109,7 @@ sub is_agent() chomp($x_bindpwd); my $cmd = $ldapsearch . " " . + "-x " . "-D \"" . $x_binddn . "\" " . "-w \"" . $x_bindpwd . "\" " . "-b \"" . "cn=TUS Officers,ou=Groups,".$x_basedn . "\" " . @@ -148,6 +149,7 @@ sub is_user() chomp($x_bindpwd); my $cmd = $ldapsearch . " " . + "-x " . "-D \"" . $x_binddn . "\" " . "-w \"" . $x_bindpwd . "\" " . "-b \"" . "ou=people,".$x_basedn . "\" " . diff --git a/pki/base/tps/forms/esc/cgi-bin/sow/enroll.cgi b/pki/base/tps/forms/esc/cgi-bin/sow/enroll.cgi index dcd3f7b25..e7e552d94 100755 --- a/pki/base/tps/forms/esc/cgi-bin/sow/enroll.cgi +++ b/pki/base/tps/forms/esc/cgi-bin/sow/enroll.cgi @@ -198,6 +198,7 @@ sub GenerateEnrollmentPage my $tmpfile = "/tmp/read-$$.txt"; my $cmd = $ldapsearch . " " . + "-x " . "-b \"" . $basedn . "\" " . "-h \"" . $ldapHost . "\" " . "-p \"" . $ldapPort ."\" " . diff --git a/pki/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi b/pki/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi index ee50298d8..d11f20ff7 100755 --- a/pki/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi +++ b/pki/base/tps/forms/esc/cgi-bin/sow/enroll_temp.cgi @@ -197,6 +197,7 @@ sub GenerateEnrollmentPage my $tmpfile = "/tmp/read-$$.txt"; my $cmd = $ldapsearch . "\" " . + "-x " . "-b \"" . $basedn . "\" " . "-h \"" . $ldapHost . "\" " . "-p \"" . $ldapPort ."\" " . diff --git a/pki/base/tps/forms/esc/cgi-bin/sow/read.cgi b/pki/base/tps/forms/esc/cgi-bin/sow/read.cgi index d13a1163e..f95b7c914 100755 --- a/pki/base/tps/forms/esc/cgi-bin/sow/read.cgi +++ b/pki/base/tps/forms/esc/cgi-bin/sow/read.cgi @@ -63,6 +63,7 @@ sub DoPage my $tmpfile = "/tmp/read-$$.txt"; my $cmd = $ldapsearch . " " . + "-x " . "-b \"" . $basedn . "\" " . "-h \"" . $ldapHost . "\" " . "-p \"" . $ldapPort ."\" " . diff --git a/pki/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi b/pki/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi index fab34e842..3741d6d1e 100755 --- a/pki/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi +++ b/pki/base/tps/forms/esc/cgi-bin/sow/read_temp.cgi @@ -63,6 +63,7 @@ sub DoPage my $tmpfile = "/tmp/read-$$.txt"; my $cmd = $ldapsearch . " " . + "-x " . "-b \"" . $basedn . "\" " . "-h \"" . $ldapHost . "\" " . "-p \"" . $ldapPort ."\" " . diff --git a/pki/base/tps/lib/perl/PKI/TPS/AdminPanel.pm b/pki/base/tps/lib/perl/PKI/TPS/AdminPanel.pm index d2a803282..6d1707483 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/AdminPanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/AdminPanel.pm @@ -175,7 +175,7 @@ sub update "-e 's/\$TOKENDB_AGENT_PWD/$password/' " . "-e 's/\$TOKENDB_AGENT_CERT/$admincert/' " . "/usr/share/$flavor/tps/scripts/addAgents.ldif > $tmp"); - system("$ldapmodify_path -h '$ldap_host' -p '$ldap_port' -D '$binddn' " . + system("$ldapmodify_path -x -h '$ldap_host' -p '$ldap_port' -D '$binddn' " . "-w '$bindpwd' -a " . "-f '$tmp'"); system("rm $tmp"); diff --git a/pki/base/tps/lib/perl/PKI/TPS/AuthDBPanel.pm b/pki/base/tps/lib/perl/PKI/TPS/AuthDBPanel.pm index 4eb05ace7..be24f665a 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/AuthDBPanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/AuthDBPanel.pm @@ -91,7 +91,7 @@ sub update my $ldapsearch_path = "/usr/bin/ldapsearch"; &PKI::TPS::Wizard::debug_log("AuthDBPanel: invoking $ldapsearch_path"); - my $status = system("$ldapsearch_path -h '$host' " . + my $status = system("$ldapsearch_path -x -h '$host' " . "-p '$port' -b '$basedn' -s base 'objectclass=*' > $tmp 2>&1"); if ($status eq "0") { &PKI::TPS::Wizard::debug_log("AuthDBPanel: auth database looks ok"); diff --git a/pki/base/tps/lib/perl/PKI/TPS/DatabasePanel.pm b/pki/base/tps/lib/perl/PKI/TPS/DatabasePanel.pm index e2030f552..a95b79589 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/DatabasePanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/DatabasePanel.pm @@ -129,13 +129,13 @@ sub update "-e 's/\$TYPE/$type/' " . "-e 's/\$VALUE/$value/' " . "/usr/share/$flavor/tps/scripts/database.ldif > $tmp"); - system("$ldapmodify_path -h '$host' -p '$port' -D '$binddn' " . + system("$ldapmodify_path -x -h '$host' -p '$port' -D '$binddn' " . "-w '$bindpwd' -a " . "-f '$tmp'"); system("rm $tmp"); # add schema - system("$ldapmodify_path -h '$host' -p '$port' " . + system("$ldapmodify_path -x -h '$host' -p '$port' " . "-D '$binddn' -w '$bindpwd' -a " . "-f '/usr/share/$flavor/tps/scripts/schemaMods.ldif'"); @@ -143,7 +143,7 @@ sub update $tmp = "/tmp/addTokens-$$.ldif"; system("sed -e 's/\$TOKENDB_ROOT/$basedn/g' " . "/usr/share/$flavor/tps/scripts/addTokens.ldif > $tmp"); - system("$ldapmodify_path -h '$host' -p '$port' -D '$binddn' " . + system("$ldapmodify_path -x -h '$host' -p '$port' -D '$binddn' " . "-w '$bindpwd' -a " . "-f '$tmp'"); system("rm $tmp"); @@ -152,7 +152,7 @@ sub update $tmp = "/tmp/addIndexes-$$.ldif"; system("sed -e 's/userRoot/$database/g' " . "/usr/share/$flavor/tps/scripts/addIndexes.ldif > $tmp"); - system("$ldapmodify_path -h '$host' -p '$port' -D '$binddn' " . + system("$ldapmodify_path -x -h '$host' -p '$port' -D '$binddn' " . "-w '$bindpwd' -a " . "-f '$tmp'"); system("rm $tmp"); @@ -161,7 +161,7 @@ sub update $tmp = "/tmp/addVLVIndexes-$$.ldif"; system("sed -e 's/userRoot/$database/g;s/\$TOKENDB_ROOT/$basedn/g' " . "/usr/share/$flavor/tps/scripts/addVLVIndexes.ldif > $tmp"); - system("$ldapmodify_path -h '$host' -p '$port' -D '$binddn' " . + system("$ldapmodify_path -x -h '$host' -p '$port' -D '$binddn' " . "-w '$bindpwd' -a " . "-f '$tmp'"); system("rm $tmp"); diff --git a/pki/base/tps/setup/create.pl b/pki/base/tps/setup/create.pl index 931260d03..e8da7d859 100755 --- a/pki/base/tps/setup/create.pl +++ b/pki/base/tps/setup/create.pl @@ -953,7 +953,7 @@ sub LDAPModify $OrgPath = &getPath(); &setPath($serverRoot . "/shared/lib" . $pathSep . $OrgPath); - system("$serverRoot/shared/bin/ldapmodify -h '$tusHost' -p '$tusPort' -D 'cn=directory manager' -w '$tusPass' -f '$file'"); + system("$serverRoot/shared/bin/ldapmodify -x -h '$tusHost' -p '$tusPort' -D 'cn=directory manager' -w '$tusPass' -f '$file'"); &setPath($OrgPath); } @@ -965,7 +965,7 @@ sub LDAPAdd $OrgPath = &getPath(); &setPath($serverRoot . "/shared/lib" . $pathSep . $OrgPath); - system("$serverRoot/shared/bin/ldapmodify -h '$tusHost' -p '$tusPort' -D 'cn=directory manager' -w '$tusPass' -a -f '$file'"); + system("$serverRoot/shared/bin/ldapmodify -x -h '$tusHost' -p '$tusPort' -D 'cn=directory manager' -w '$tusPass' -a -f '$file'"); &setPath($OrgPath); } -- cgit