diff options
author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-05-08 17:55:18 +0000 |
---|---|---|
committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2009-05-08 17:55:18 +0000 |
commit | 516d4fdf7da46625f64118b88e3248da7c8da5aa (patch) | |
tree | 653e5fb0ce7f6cf01deadc523a2d904d221832d5 /pki/base/tps | |
parent | dcb4f06af4ea608dbe0ac1ceeb1dff1930eac6d5 (diff) | |
download | pki-516d4fdf7da46625f64118b88e3248da7c8da5aa.tar.gz pki-516d4fdf7da46625f64118b88e3248da7c8da5aa.tar.xz pki-516d4fdf7da46625f64118b88e3248da7c8da5aa.zip |
Bugzilla Bug #492735 - Configuration wizard stores certain incorrect port
values within TPS "CS.cfg" . . .
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@434 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/tps')
-rw-r--r-- | pki/base/tps/doc/CS.cfg | 1 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/TPS/DisplayCertChainPanel.pm | 8 | ||||
-rwxr-xr-x | pki/base/tps/lib/perl/PKI/TPS/SecurityDomainPanel.pm | 86 |
3 files changed, 93 insertions, 2 deletions
diff --git a/pki/base/tps/doc/CS.cfg b/pki/base/tps/doc/CS.cfg index 814913b5..f42046c6 100644 --- a/pki/base/tps/doc/CS.cfg +++ b/pki/base/tps/doc/CS.cfg @@ -26,6 +26,7 @@ pkicreate.non_clientauth_secure_port=[NON_CLIENTAUTH_SECURE_PORT] pkicreate.unsecure_port=[PORT] pkicreate.user=[USERID] pkicreate.group=[GROUPID] +pkiremove.cert.subsystem.nickname=subsystemCert cert-[INSTANCE_ID] cs.type=TPS service.machineName=[SERVER_NAME] service.instanceDir=[SERVER_ROOT] diff --git a/pki/base/tps/lib/perl/PKI/TPS/DisplayCertChainPanel.pm b/pki/base/tps/lib/perl/PKI/TPS/DisplayCertChainPanel.pm index 841d9dcc..01f6e76d 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/DisplayCertChainPanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/DisplayCertChainPanel.pm @@ -273,6 +273,14 @@ sub get_domain_xml $::config->put( "config.sdomainHttpURL", $http_ee_port ); $::config->put( "config.sdomainAgentURL", $https_agent_port ); $::config->put( "config.sdomainEEURL", $https_ee_port ); + + # Store additional values necessary for 'pkiremove' . . . + $::config->put( "securitydomain.httpport", + $c->{'UnSecurePort'}[0] ); + $::config->put( "securitydomain.httpsagentport", + $c->{'SecureAgentPort'}[0] ); + $::config->put( "securitydomain.httpseeport", + $c->{'SecurePort'}[0] ); } $count++; diff --git a/pki/base/tps/lib/perl/PKI/TPS/SecurityDomainPanel.pm b/pki/base/tps/lib/perl/PKI/TPS/SecurityDomainPanel.pm index 700fc487..a7f46dbd 100755 --- a/pki/base/tps/lib/perl/PKI/TPS/SecurityDomainPanel.pm +++ b/pki/base/tps/lib/perl/PKI/TPS/SecurityDomainPanel.pm @@ -71,15 +71,77 @@ sub has_sub_panel return 0; } +sub pingCS +{ + my( $instanceDir ) = $_[0]; + my( $db_password ) = $_[1]; + my( $nickname ) = $_[2]; + my( $hostname ) = $_[3]; + my( $port ) = $_[4]; + + my $content = `/usr/bin/sslget -d $instanceDir/alias -p $db_password -v -n \"$nickname\" -r "/ca/admin/ca/getStatus" $hostname:$port`; + if( "$content" eq "" ) { + return 0; + } else { + $content =~ /(\<XMLResponse\>.*\<\/XMLResponse\>)/; + $content = $1; + + my $parser = XML::Simple->new(); + my $response = $parser->XMLin($content); + my $state = $response->{State}; + + if( "$state" eq "1" ) { + return 1; + } else { + return 0; + } + } +} + sub display { my ($q) = @_; &PKI::TPS::Wizard::debug_log("SecurityPanel: display"); $::symbol{panelname} = "Security Domain"; $::symbol{sdomainName} = "Security Domain"; + + my $instanceDir = $::config->get("service.instanceDir"); + my $db_password = `grep \"internal:\" \"$instanceDir/conf/password.conf\" | cut -c10-`; + $db_password =~ s/\n$//g; + my $nickname = $::config->get("preop.cert.sslserver.nickname"); my $hostname = $::config->get("service.machineName"); - $::symbol{sdomainAdminURL} = "https://" . $hostname . ":9445"; + my $default_https_admin_port = 9445; + + # check to see if "default" security domain exists on local machine + my $status = pingCS( $instanceDir, + $db_password, + $nickname, + $hostname, + $default_https_admin_port ); + if( "$status" eq "1" ) { + # "default" security domain exists on local machine; + # fill "sdomainURL" in with "default" security domain + # as an initial "guess" + $::symbol{sdomainURL} = "https://" . $hostname . ":" + . $default_https_admin_port; + } else { + # "default" security domain does NOT exist on local machine; + # leave "sdomainURL" blank + $::symbol{sdomainURL} = ""; + } + $::symbol{sdomainAdminURL} = "https://" . $hostname . ":" + . $default_https_admin_port; + + my $initCommand = ""; + my $instanceID = "<security_domain_instance_name> "; + if( $^O eq "linux" ) { + $initCommand = "/sbin/service $instanceID"; + } else { + ## default case: e. g. - ( $^O eq "solaris" ) + $initCommand = "/etc/init.d/$instanceID"; + } + $::symbol{initCommand} = $initCommand; return 1; } @@ -90,9 +152,29 @@ sub update &PKI::TPS::Wizard::debug_log("SecurityPanel: update"); my $sdomainURL = $q->param("sdomainURL"); + if ($sdomainURL eq "") { + &PKI::TPS::Wizard::debug_log("SecurityPanel: sdomainURL has not been specified!"); + $::symbol{errorString} = "Security Domain HTTPS has not been specified!"; + return 0; + } + my $sdomainURL_info = new URI::URL($sdomainURL); - if ($sdomainURL eq "") { + my $instanceDir = $::config->get("service.instanceDir"); + my $db_password = `grep \"internal:\" \"$instanceDir/conf/password.conf\" | cut -c10-`; + $db_password =~ s/\n$//g; + my $nickname = $::config->get("preop.cert.sslserver.nickname"); + my $hostname = $sdomainURL_info->host; + my $https_admin_port = $sdomainURL_info->port; + + # check to see if "default" security domain exists on local machine + my $status = pingCS( $instanceDir, + $db_password, + $nickname, + $hostname, + $https_admin_port ); + if( "$status" ne "1" ) { + # invalid security domain specified &PKI::TPS::Wizard::debug_log("SecurityPanel: sdomainURL not found"); $::symbol{errorString} = "Security Domain HTTPS Admin URL not found"; return 0; |