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/ra | |
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/ra')
-rw-r--r-- | pki/base/ra/doc/CS.cfg | 1 | ||||
-rwxr-xr-x | pki/base/ra/lib/perl/PKI/RA/DisplayCertChainPanel.pm | 8 | ||||
-rwxr-xr-x | pki/base/ra/lib/perl/PKI/RA/SecurityDomainPanel.pm | 86 |
3 files changed, 93 insertions, 2 deletions
diff --git a/pki/base/ra/doc/CS.cfg b/pki/base/ra/doc/CS.cfg index c580d2741..5f51a89d2 100644 --- a/pki/base/ra/doc/CS.cfg +++ b/pki/base/ra/doc/CS.cfg @@ -24,6 +24,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] request._000=######################################### request._001=# Request Queue Parameters request._002=######################################### diff --git a/pki/base/ra/lib/perl/PKI/RA/DisplayCertChainPanel.pm b/pki/base/ra/lib/perl/PKI/RA/DisplayCertChainPanel.pm index 54e9b85cf..06f8b992e 100755 --- a/pki/base/ra/lib/perl/PKI/RA/DisplayCertChainPanel.pm +++ b/pki/base/ra/lib/perl/PKI/RA/DisplayCertChainPanel.pm @@ -274,6 +274,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/ra/lib/perl/PKI/RA/SecurityDomainPanel.pm b/pki/base/ra/lib/perl/PKI/RA/SecurityDomainPanel.pm index ce622f915..857f3a976 100755 --- a/pki/base/ra/lib/perl/PKI/RA/SecurityDomainPanel.pm +++ b/pki/base/ra/lib/perl/PKI/RA/SecurityDomainPanel.pm @@ -72,15 +72,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::RA::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; } @@ -91,9 +153,29 @@ sub update &PKI::RA::Wizard::debug_log("SecurityPanel: update"); my $sdomainURL = $q->param("sdomainURL"); + if ($sdomainURL eq "") { + &PKI::RA::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::RA::Wizard::debug_log("SecurityPanel: sdomainURL not found"); $::symbol{errorString} = "Security Domain HTTPS Admin URL not found"; return 0; |