Mailinglist Archive: yast-commit (723 mails)

< Previous Next >
[yast-commit] r47413 - /trunk/ldap-server/src/LdapServer.pm
  • From: rhafer@xxxxxxxxxxxxxxxx
  • Date: Fri, 09 May 2008 12:15:07 -0000
  • Message-id: <20080509121507.9BD472DE5A@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Fri May 9 14:15:06 2008
New Revision: 47413

URL: http://svn.opensuse.org/viewcvs/yast?rev=47413&view=rev
Log:
Don't start/enable LDAP Server when the configuration of the initial
database failed (Partly fixes bnc#388270)

Modified:
trunk/ldap-server/src/LdapServer.pm

Modified: trunk/ldap-server/src/LdapServer.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?rev=47413&r1=47412&r2=47413&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapServer.pm (original)
+++ trunk/ldap-server/src/LdapServer.pm Fri May 9 14:15:06 2008
@@ -634,7 +634,7 @@
#sleep($sl);

Progress->NextStage();
-
+ my $failure = 0;
if( $serviceEnabled )
{
foreach my $db (@$dbListNEW) {
@@ -645,7 +645,15 @@
{
# Error message
Report->Error( sprintf( __("Cannot add new database '%s'."),
$db ) );
- next;
+
+ # Stop here and don't start the server when creating the
first db failed
+ if ( ( @{$dbList} == 0 ) && ( @{$dbListNEW} == 1 ) )
+ {
+ $failure = 1;
+ last;
+ } else {
+ next;
+ }
}

#add indexes
@@ -683,37 +691,41 @@
}
}
}
-
- #sleep($sl);
-
- Progress->NextStage();
-
- if( $serviceEnabled )
+ if ( $failure )
{
- foreach my $db (@$dbList) {
-
- $ret = YaPI::LdapServer->EditDatabase($db, $database->{$db});
-
- if(! defined $ret)
- {
- # Error message
- Report->Error(sprintf(__("Cannot write the database '%s'."),
$db));
- }
-
- }
- }
+ YaPI::LdapServer->ModifyService(0);
+ Progress->Finish();
+ return 0;
+ } else {
+ Progress->NextStage();

- YaPI::LdapServer->SwitchService($serviceEnabled);
- my $progress_orig = Progress->set(0);
- SuSEFirewall->Write();
- Progress->set($progress_orig);
+ if( $serviceEnabled )
+ {
+ foreach my $db (@$dbList) {
+
+ $ret = YaPI::LdapServer->EditDatabase($db, $database->{$db});
+
+ if(! defined $ret)
+ {
+ # Error message
+ Report->Error(sprintf(__("Cannot write the database
'%s'."), $db));
+ }

- #sleep($sl);
+ }
+ }

- # Progress finished
- Progress->NextStage();
- sleep(1);
- return 1;
+ YaPI::LdapServer->SwitchService($serviceEnabled);
+ my $progress_orig = Progress->set(0);
+ SuSEFirewall->Write();
+ Progress->set($progress_orig);
+
+ #sleep($sl);
+
+ # Progress finished
+ Progress->NextStage();
+ sleep(1);
+ return 1;
+ }
}

BEGIN { $TYPEINFO{WritePPolicyObjects} = ["function", "boolean"]; }

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

< Previous Next >
This Thread
  • No further messages