[yast-commit] r48647 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc wizards.ycp
Author: rhafer Date: Fri Jun 27 16:00:28 2008 New Revision: 48647 URL: http://svn.opensuse.org/viewcvs/yast?rev=48647&view=rev Log: Set sane defaults for caches and indexing in Proposal Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/agent/SlapdConfigAgent.cc 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=48647&r1=48646&r2=48647&view=diff ============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Fri Jun 27 16:00:28 2008 @@ -36,6 +36,50 @@ my $registerSlp = 0; my $useLdapiForConfig = 0; my %dbDefaults = (); +my @defaultIndexes = ( + { "name" => "objectclass", + "eq" => YaST::YCP::Boolean(1) + }, + { "name" => "uidNumber", + "eq" => YaST::YCP::Boolean(1) + }, + { "name" => "gidNumber", + "eq" => YaST::YCP::Boolean(1) + }, + { "name" => "member", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1) + }, + { "name" => "mail", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1) + }, + { "name" => "cn", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1), + "sub" => YaST::YCP::Boolean(1) + }, + { "name" => "displayName", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1), + "sub" => YaST::YCP::Boolean(1) + }, + { "name" => "uid", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1), + "sub" => YaST::YCP::Boolean(1) + }, + { "name" => "sn", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1), + "sub" => YaST::YCP::Boolean(1) + }, + { "name" => "givenName", + "eq" => YaST::YCP::Boolean(1), + "pres" => YaST::YCP::Boolean(1), + "sub" => YaST::YCP::Boolean(1) + } + ); my @databases = (); my @schema = (); @@ -545,6 +589,10 @@ $dbDefaults{'rootpw'} = ""; $dbDefaults{'rootpw_clear'} = ""; $dbDefaults{'pwenctype'} = "SSHA"; + $dbDefaults{'entrycache'} = 10000; + $dbDefaults{'idlcache'} = 10000; + + $dbDefaults{'defaultIndex'} = YaST::YCP::Boolean(1); $dbDefaults{'serviceEnabled'} = YaST::YCP::Boolean(0); $dbDefaults{'slpRegister'} = YaST::YCP::Boolean(0); return 1; @@ -559,11 +607,11 @@ 'suffix' => $dbDefaults{'basedn'}, 'rootdn' => $dbDefaults{'rootdn'}, 'rootpw' => $pwHash, - 'directory' => '/var/lib/ldap' - }; + 'directory' => '/var/lib/ldap', + 'entrycache' => $dbDefaults{'entrycache'}, + 'idlcache' => $dbDefaults{'idlcache'} }; my $cfgdatabase = { 'type' => 'config', - 'rootdn' => 'cn=config' - }; + 'rootdn' => 'cn=config' }; @schema = ( "core", "cosine", "inetorgperson" ); @@ -571,6 +619,13 @@ SCR->Execute('.ldapserver.initSchema', \@schema ); SCR->Execute('.ldapserver.initDatabases', [ $cfgdatabase, $database ] ); my $rc = SCR->Read('.ldapserver.databases'); + if ( $dbDefaults{'defaultIndex'} == 1 ) + { + foreach my $idx ( @defaultIndexes ) + { + $self->ChangeDatabaseIndex(1, $idx ); + } + } y2milestone("Databases: ". Data::Dumper->Dump([$rc])); @databases = @{$rc}; return 1; Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfigAgent.cc?rev=48647&r1=48646&r2=48647&view=diff ============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:00:28 2008 @@ -218,6 +218,14 @@ { db->setDirectory( j.value()->asString()->value_cstr() ); } + else if (std::string("entrycache") == j.key()->asString()->value_cstr() ) + { + db->setStringValue( "olcDbCachesize", j.value()->asString()->value_cstr() ); + } + else if (std::string("idlcache") == j.key()->asString()->value_cstr() ) + { + db->setStringValue( "olcDbIdlCachesize", j.value()->asString()->value_cstr() ); + } } databases.push_back(db); } Modified: trunk/ldap-server/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/wizards.ycp?rev=48647&r1=48646&r2=48647&view=diff ============================================================================== --- trunk/ldap-server/src/wizards.ycp (original) +++ trunk/ldap-server/src/wizards.ycp Fri Jun 27 16:00:28 2008 @@ -70,8 +70,7 @@ "database" : $[ `next : "summary", `back : `back, - `abort : `back, - `cancel : `back + `abort : `abort, ], "summary" : $[ `next : "write", -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
rhafer@svn.opensuse.org