Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49793 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc dialogs.ycp tree_structure.ycp wizards.ycp
  • From: rhafer@xxxxxxxxxxxxxxxx
  • Date: Wed, 06 Aug 2008 16:22:47 -0000
  • Message-id: <20080806162247.D31972A00C@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Wed Aug 6 18:22:47 2008
New Revision: 49793

URL: http://svn.opensuse.org/viewcvs/yast?rev=49793&view=rev
Log:
- Added TLS Settings Dialog to ProposalWizard()
- fixed some initialization problems during ProposalSequence

Modified:
trunk/ldap-server/src/LdapServer.pm
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/dialogs.ycp
trunk/ldap-server/src/tree_structure.ycp
trunk/ldap-server/src/wizards.ycp

Modified: trunk/ldap-server/src/LdapServer.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?rev=49793&r1=49792&r2=49793&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapServer.pm (original)
+++ trunk/ldap-server/src/LdapServer.pm Wed Aug 6 18:22:47 2008
@@ -43,6 +43,7 @@
my $useLdapiForConfig = 0;
my %dbDefaults = ();

+my $globals_initialized = 0;
my $use_ldapi_listener = 0;
my $use_ldaps_listener = 0;
my $use_ldap_listener = 0;
@@ -761,7 +762,7 @@
{
my $self = shift;
my $tls = shift;
- if ( YaST::YCP::Boolean($tls->{'tls_active'}) )
+ if ( $tls->{'tls_active'} )
{
if ( SCR->Read(".target.size", $tls->{"caCertFile"}) <= 0)
{
@@ -950,6 +951,27 @@
return 1;
}

+BEGIN { $TYPEINFO {InitGlobals} = ["function", "boolean"]; }
+sub InitGlobals
+{
+ my $self = shift;
+ if ( ! $globals_initialized )
+ {
+ SCR->Execute('.ldapserver.initGlobals' );
+ if(! $self->HaveCommonServerCertificate() )
+ {
+ y2milestone( _("Common server certificate not available. StartTLS
is disabled.") );
+ }
+ else
+ {
+ $self->SetTlsConfigCommonCert();
+ $self->SetProtocolListenerEnabled("ldaps", 1);
+ }
+ $globals_initialized = 1;
+ }
+ return 1;
+}
+
BEGIN { $TYPEINFO {ReadFromDefaults} = ["function", "boolean"]; }
sub ReadFromDefaults
{
@@ -976,7 +998,7 @@
]
};

- SCR->Execute('.ldapserver.initGlobals' );
+ $self->InitGlobals();
SCR->Execute('.ldapserver.initSchema' );
my $rc = SCR->Write(".ldapserver.schema.addFromLdif",
"/etc/openldap/schema/core.ldif" );
if ( ! $rc ) {

Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfigAgent.cc?rev=49793&r1=49792&r2=49793&view=diff
==============================================================================
--- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original)
+++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Wed Aug 6 18:22:47 2008
@@ -746,16 +746,22 @@
{
if ( ! i.value().isNull() )
tls.setCaCertFile(i.value()->asString()->value_cstr()
);
+ else
+ tls.setCaCertFile("");
}
else if ( key == "certFile" )
{
if ( ! i.value().isNull() )
tls.setCertFile(i.value()->asString()->value_cstr() );
+ else
+ tls.setCertFile("");
}
else if ( key == "certKeyFile" )
{
if ( ! i.value().isNull() )
tls.setCertKeyFile(i.value()->asString()->value_cstr()
);
+ else
+ tls.setCertKeyFile("");
}
else if ( key == "crlCheck" )
{
@@ -764,6 +770,9 @@
{
if ( ! i.value().isNull() )
tls.setCrlFile (i.value()->asString()->value_cstr() );
+ else
+ tls.setCertKeyFile("");
+
}
else if ( key == "verifyClient" )
{

Modified: trunk/ldap-server/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/dialogs.ycp?rev=49793&r1=49792&r2=49793&view=diff
==============================================================================
--- trunk/ldap-server/src/dialogs.ycp (original)
+++ trunk/ldap-server/src/dialogs.ycp Wed Aug 6 18:22:47 2008
@@ -256,6 +256,41 @@
return ret;
}

+any TlsConfigDialog()
+{
+ Wizard::SetContentsButtons( caption, tlsWidget, HELPS["tls_dialog"]:"help
not found", Label::BackButton(), Label::NextButton() );
+ LdapServer::InitGlobals();
+ cb_read_tls();
+ any ret = nil;
+ while( true )
+ {
+ ret = UI::UserInput();
+ y2milestone( "TlsConfigDialog: seeing return value '%1'", ret );
+
+ if( ret == `back || ret == `abort || ret == `cancel)
+ {
+ break;
+ }
+ else if( ret == `next || ret == `finish )
+ {
+ if (! cb_write_tls() )
+ {
+ Report::Error( callback_error );
+ continue;
+ }
+ break;
+ }
+ else if( is( ret, symbol ) )
+ {
+ handler_cmd = (symbol)ret;
+ cb_input_tls();
+ }
+ }
+
+ return ret;
+
+}
+
any ProposalDialog()
{
map <string, any> defaults = LdapServer::GetInitialDefaults();

Modified: trunk/ldap-server/src/tree_structure.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.ycp?rev=49793&r1=49792&r2=49793&view=diff
==============================================================================
--- trunk/ldap-server/src/tree_structure.ycp (original)
+++ trunk/ldap-server/src/tree_structure.ycp Wed Aug 6 18:22:47 2008
@@ -365,8 +365,24 @@
"caCertDir" : "",
"crlFile" : "",
"crlCheck" : 0,
- "verifyClient" : 0
+ "verifyClient" : 0,
+ "tls_active" : true
];
+ if ( (string)tlsSettings["caCertFile"]:"" == "" )
+ {
+ callback_error = _("Please select a valid CA Certificate File");
+ return false;
+ }
+ if ( (string)tlsSettings["certFile"]:"" == "" )
+ {
+ callback_error = _("Please select a valid Certificate File");
+ return false;
+ }
+ if ( (string)tlsSettings["certKeyFile"]:"" == "" )
+ {
+ callback_error = _("Please select a valid Certificate Key File");
+ return false;
+ }
if ( ! LdapServer::SetTlsConfig( tlsSettings ) )
{
map<string, string> err = LdapServer::GetError();
@@ -466,6 +482,7 @@
else if( handler_cmd == `pb_launch_ca )
{
WFM::CallFunction("ca_mgm", [] );
+ cb_read_tls();
}
//reread tls page
return true;

Modified: trunk/ldap-server/src/wizards.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/wizards.ycp?rev=49793&r1=49792&r2=49793&view=diff
==============================================================================
--- trunk/ldap-server/src/wizards.ycp (original)
+++ trunk/ldap-server/src/wizards.ycp Wed Aug 6 18:22:47 2008
@@ -62,6 +62,7 @@

map aliases = $[
"startup" : ``( EnableServiceDialog() ),
+ "tlssettings" : ``( TlsConfigDialog() ),
"database" : ``( ProposalDialog() ),
"summary" : ``(SummaryDialog() ),
"advanced" : ``(MainSequence() ),
@@ -71,6 +72,9 @@
map sequence = $[
"ws_start" : "startup",
"startup" : $[
+ `next : "tlssettings"
+ ],
+ "tlssettings" : $[
`next : "database"
],
"database" : $[

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages