Mailing Lists
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2023
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
List overview
Download
YaST Commits
June 2008
----- 2023 -----
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
yast-commit@lists.opensuse.org
27 participants
711 discussions
Start a n
N
ew thread
[yast-commit] r48650 - in /trunk/ldap-server/src: LdapServer.pm complex.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:40 2008 New Revision: 48650 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48650&view=rev
Log: - Add some default ACLs to frontend - Set checkpoint for initial BDB database Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/complex.ycp Modified: trunk/ldap-server/src/LdapServer.pm URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?re…
============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Fri Jun 27 16:00:40 2008 @@ -21,7 +21,7 @@ use MIME::Base64; use X500::DN; use ycp; -use YaST::YCP qw(Boolean); +use YaST::YCP; our %TYPEINFO; @@ -84,6 +84,44 @@ my @databases = (); my @schema = (); +my @globalAcl = ( + { 'what' => + { 'filter' => undef, + 'attr' => undef, + 'dn' => + { + 'style' => "base", + 'dn' => "" + } + }, + 'who' => + [ + { 'whotype' => "all", + 'whovalue' => undef, + 'level' => "read", + 'priv' => undef + } + ] + }, + { 'what' => + { 'filter' => undef, + 'attr' => undef, + 'dn' => + { 'style' => "base", + 'dn' => "cn=Subschema" + } + }, + 'who' => + [ + { 'whotype' => "all", + 'whovalue' => undef, + 'level' => "read", + 'priv' => undef + } + ] + } +); + ## # Read all ldap-server settings # @return true on success @@ -226,8 +264,10 @@ "/usr/sbin/slapadd -F /etc/openldap/slapd.d -b cn=config -l $tmpfile" ); if ( $rc->{'exit'} ) { + $self->SetError( _("Error while populating the configurations database with \"slapadd\"."), + $rc->{'stderr'} ); y2error("Error during slapadd:" .$rc->{'stderr'}); - $ret = 0; + return 0; } } else @@ -557,6 +597,8 @@ my $defaults = shift; $defaults->{'serviceEnabled'} = YaST::YCP::Boolean($defaults->{'serviceEnabled'}); $defaults->{'slpRegister'} = YaST::YCP::Boolean($defaults->{'slpRegister'}); + $defaults->{'checkpoint'} = [ YaST::YCP::Integer($defaults->{'checkpoint'}->[0]), + YaST::YCP::Integer($defaults->{'checkpoint'}->[1]) ]; y2milestone("SetInitialDefaults: ". Data::Dumper->Dump([$defaults])); %dbDefaults = %$defaults; return 1; @@ -591,6 +633,8 @@ $dbDefaults{'pwenctype'} = "SSHA"; $dbDefaults{'entrycache'} = 10000; $dbDefaults{'idlcache'} = 10000; + $dbDefaults{'checkpoint'} = [ YaST::YCP::Integer(1024), + YaST::YCP::Integer(5) ]; $dbDefaults{'defaultIndex'} = YaST::YCP::Boolean(1); $dbDefaults{'serviceEnabled'} = YaST::YCP::Boolean(0); @@ -608,16 +652,26 @@ 'rootdn' => $dbDefaults{'rootdn'}, 'rootpw' => $pwHash, 'directory' => '/var/lib/ldap', - 'entrycache' => $dbDefaults{'entrycache'}, - 'idlcache' => $dbDefaults{'idlcache'} }; + 'entrycache' => YaST::YCP::Integer($dbDefaults{'entrycache'}), + 'idlcache' => YaST::YCP::Integer($dbDefaults{'idlcache'}), + 'checkpoint' => $dbDefaults{'checkpoint'} }; my $cfgdatabase = { 'type' => 'config', 'rootdn' => 'cn=config' }; + my $frontenddb = { 'type' => 'frontend', + 'access' => [ + 'to dn.base="" by * read', + 'to dn.base="cn=Subschema" by * read', + 'to attrs=userPassword,userPKCS12 by self write by * auth', + # 'to attrs=shadowLastChange by self write by * read', + 'to * by * read' + ] + }; @schema = ( "core", "cosine", "inetorgperson" ); SCR->Execute('.ldapserver.initGlobals' ); SCR->Execute('.ldapserver.initSchema', \@schema ); - SCR->Execute('.ldapserver.initDatabases', [ $cfgdatabase, $database ] ); + SCR->Execute('.ldapserver.initDatabases', [ $frontenddb, $cfgdatabase, $database ] ); my $rc = SCR->Read('.ldapserver.databases'); if ( $dbDefaults{'defaultIndex'} == 1 ) { Modified: trunk/ldap-server/src/complex.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/complex.ycp?rev=…
============================================================================== --- trunk/ldap-server/src/complex.ycp (original) +++ trunk/ldap-server/src/complex.ycp Fri Jun 27 16:00:40 2008 @@ -404,6 +404,16 @@ // LdapServer::AbortFunction = PollAbort; boolean ret = LdapServer::Write(); if (! ret ) { + map<string,string> err = LdapServer::GetError(); + if (err["details"]:"" != "" ) + { + Popup::ErrorDetails( err["msg"]:"", err["details"]:"" ); + } + else + { + Popup::Error( err["msg"]:"unknown" ); + } + return `abort; } // ret = LdapServer::WritePPolicyObjects(); -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48649 - /trunk/ldap-server/src/agent/SlapdConfigAgent.cc
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:36 2008 New Revision: 48649 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48649&view=rev
Log: reworked ".initDatabases" code to share code between different backend types Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:00:36 2008 @@ -195,63 +195,71 @@ YCPMap dbMap = dbList->value(i)->asMap(); std::string dbtype(dbMap->value(YCPString("type"))->asString()->value_cstr()); y2milestone("Database Type: %s", dbtype.c_str()); + boost::shared_ptr<OlcDatabase> db; if ( dbtype == "bdb" ) { - boost::shared_ptr<OlcBdbDatabase> db(new OlcBdbDatabase() ); - db->setIndex(i); - YCPMapIterator j = dbMap.begin(); - for ( ; j != dbMap.end(); j++ ) + db = boost::shared_ptr<OlcDatabase>(new OlcBdbDatabase() ); + } + else + { + db = boost::shared_ptr<OlcDatabase>( new OlcDatabase(dbtype.c_str()) ); + } + db->setIndex(i-1); + YCPMapIterator j = dbMap.begin(); + for ( ; j != dbMap.end(); j++ ) + { + y2milestone("Key: %s, Valuetype: %s", + j.key()->asString()->value_cstr(), + j.value()->valuetype_str() ); + if ( std::string("suffix") == j.key()->asString()->value_cstr() ) { - if ( std::string("suffix") == j.key()->asString()->value_cstr() ) - { - db->setSuffix( j.value()->asString()->value_cstr() ); - } - else if (std::string("rootdn") == j.key()->asString()->value_cstr() ) - { - db->setRootDn( j.value()->asString()->value_cstr() ); - } - else if (std::string("rootpw") == j.key()->asString()->value_cstr() ) + db->setSuffix( j.value()->asString()->value_cstr() ); + continue; + } + else if (std::string("rootdn") == j.key()->asString()->value_cstr() ) + { + db->setRootDn( j.value()->asString()->value_cstr() ); + continue; + } + else if (std::string("rootpw") == j.key()->asString()->value_cstr() ) + { + db->setRootPw( j.value()->asString()->value_cstr() ); + continue; + } + else if (std::string("access") == j.key()->asString()->value_cstr() ) + { + YCPList aclList = j.value()->asList(); + for ( int k=0 ; k < aclList.size(); k++ ) { - db->setRootPw( j.value()->asString()->value_cstr() ); + db->addStringValue( "olcAccess", aclList.value(k)->asString()->value_cstr() ); } - else if (std::string("directory") == j.key()->asString()->value_cstr() ) + continue; + } + if ( dbtype == "bdb" ) + { + boost::shared_ptr<OlcBdbDatabase> bdb = + boost::dynamic_pointer_cast<OlcBdbDatabase>(db); + if (std::string("directory") == j.key()->asString()->value_cstr() ) { - db->setDirectory( j.value()->asString()->value_cstr() ); + bdb->setDirectory( j.value()->asString()->value_cstr() ); } else if (std::string("entrycache") == j.key()->asString()->value_cstr() ) { - db->setStringValue( "olcDbCachesize", j.value()->asString()->value_cstr() ); + bdb->setEntryCache( j.value()->asInteger()->value() ); } else if (std::string("idlcache") == j.key()->asString()->value_cstr() ) { - db->setStringValue( "olcDbIdlCachesize", j.value()->asString()->value_cstr() ); - } - } - databases.push_back(db); - } - else - { - y2error("Database Type \"%s\" not supported. Trying to use generic Database class", dbtype.c_str()); - boost::shared_ptr<OlcDatabase> db(new OlcDatabase(dbtype.c_str()) ); - db->setIndex(i); - YCPMapIterator j = dbMap.begin(); - for ( ; j != dbMap.end(); j++ ) - { - if ( std::string("suffix") == j.key()->asString()->value_cstr() ) - { - db->setSuffix( j.value()->asString()->value_cstr() ); - } - else if (std::string("rootdn") == j.key()->asString()->value_cstr() ) - { - db->setRootDn( j.value()->asString()->value_cstr() ); + bdb->setIdlCache( j.value()->asInteger()->value() ); } - else if (std::string("rootpw") == j.key()->asString()->value_cstr() ) + else if (std::string("checkpoint") == j.key()->asString()->value_cstr() ) { - db->setRootPw( j.value()->asString()->value_cstr() ); + YCPList cpList = j.value()->asList(); + bdb->setCheckPoint( cpList->value(0)->asInteger()->value(), + cpList->value(1)->asInteger()->value() ); } } - databases.push_back(db); } + databases.push_back(db); } } else if ( path->component_str(0) == "commitChanges" ) @@ -829,7 +837,7 @@ ppolicyOlc = *j; } YCPMap argMap = arg->asMap(); - y2milestone("Mapsize: %d", argMap.size()); + y2milestone("Mapsize: %ld", argMap.size()); if ( argMap.size() == 0 ){ y2milestone("Delete ppolicy overlay"); ppolicyOlc->clearChangedEntry(); -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48648 - in /trunk/ldap-server/src/lib: slapd-config.cpp slapd-config.h
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:33 2008 New Revision: 48648 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48648&view=rev
Log: Helper methods for caching and checkpoint settings Modified: trunk/ldap-server/src/lib/slapd-config.cpp trunk/ldap-server/src/lib/slapd-config.h Modified: trunk/ldap-server/src/lib/slapd-config.cpp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
============================================================================== --- trunk/ldap-server/src/lib/slapd-config.cpp (original) +++ trunk/ldap-server/src/lib/slapd-config.cpp Fri Jun 27 16:00:33 2008 @@ -221,6 +221,39 @@ this->setStringValue("olcDbDirectory", dir); } +int OlcBdbDatabase::getEntryCache() const +{ + return this->getIntValue( "olcDbCachesize" ); +} + +void OlcBdbDatabase::setEntryCache( int cachesize ) +{ + this->setIntValue( "olcDbCachesize", cachesize ); +} + +int OlcBdbDatabase::getIdlCache() const +{ + return this->getIntValue( "olcDbIdlCachesize" ); +} + +void OlcBdbDatabase::setIdlCache( int cachesize ) +{ + this->setIntValue( "olcDbIdlCachesize", cachesize ); +} + +void OlcBdbDatabase::setCheckPoint( int kbytes, int min ) +{ + std::ostringstream oStr; + oStr << kbytes << " " << min; + this->setStringValue( "olcDbCheckpoint", oStr.str() ); +} + +//int[] OlcBdbDatabase::getCheckPoint() +//{ +// int[2] ret = { 0,0 }; +// return ret; +//} + OlcGlobalConfig::OlcGlobalConfig() : OlcConfigEntry() { m_dbEntryChanged.setDN("cn=config"); @@ -748,6 +781,26 @@ } } +int OlcConfigEntry::getIntValue( const std::string &type ) const +{ + StringList sl = this->getStringValues(type); + if ( sl.size() == 1 ) { + std::istringstream iStr(*sl.begin()); + int value; + iStr >> value; + return value; + } else { + throw(std::runtime_error("Attribute is not single-valued") ); + } +} + +void OlcConfigEntry::setIntValue( const std::string &type, int value ) +{ + std::ostringstream oStr; + oStr << value; + this->setStringValue( type, oStr.str() ); +} + std::string OlcConfigEntry::toLdif() const { std::ostringstream ldifStream; Modified: trunk/ldap-server/src/lib/slapd-config.h URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
============================================================================== --- trunk/ldap-server/src/lib/slapd-config.h (original) +++ trunk/ldap-server/src/lib/slapd-config.h Fri Jun 27 16:00:33 2008 @@ -47,6 +47,9 @@ void setStringValue(const std::string &type, const std::string &value); void addStringValue(const std::string &type, const std::string &value); + int getIntValue( const std::string &type ) const; + void setIntValue( const std::string &type, int value ); + void setIndex( int index ); int getEntryIndex() const; @@ -135,6 +138,15 @@ virtual std::vector<IndexType> getDatabaseIndex( const std::string &attr ) const; virtual void addIndex(const std::string& attr, const std::vector<IndexType>& idx); virtual void deleteIndex(const std::string& attr); + + int getEntryCache() const; + void setEntryCache( int cachesize ); + + int getIdlCache() const; + void setIdlCache( int cachesize ); + + void setCheckPoint( int kbytes, int min ); + //int[] getCheckPoint() const; }; class OlcTlsSettings; -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48647 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc wizards.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
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?re…
============================================================================== --- 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/SlapdConfi…
============================================================================== --- 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=…
============================================================================== --- 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(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48646 - in /trunk/ldap-server/src: LdapServer.pm dialogs.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:24 2008 New Revision: 48646 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48646&view=rev
Log: Set rootpw upon database creation Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/dialogs.ycp Modified: trunk/ldap-server/src/LdapServer.pm URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?re…
============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Fri Jun 27 16:00:24 2008 @@ -542,6 +542,8 @@ y2milestone("basedn: $basedn"); $dbDefaults{'basedn'} = $basedn; $dbDefaults{'rootdn'} = "cn=admin,".$basedn; + $dbDefaults{'rootpw'} = ""; + $dbDefaults{'rootpw_clear'} = ""; $dbDefaults{'pwenctype'} = "SSHA"; $dbDefaults{'serviceEnabled'} = YaST::YCP::Boolean(0); $dbDefaults{'slpRegister'} = YaST::YCP::Boolean(0); @@ -551,23 +553,26 @@ BEGIN { $TYPEINFO {ReadFromDefaults} = ["function", "boolean"]; } sub ReadFromDefaults { + my $self = shift; + my $pwHash = $self->HashPassword($dbDefaults{'pwenctype'}, $dbDefaults{'rootpw_clear'} ); my $database = { 'type' => 'bdb', 'suffix' => $dbDefaults{'basedn'}, 'rootdn' => $dbDefaults{'rootdn'}, + 'rootpw' => $pwHash, 'directory' => '/var/lib/ldap' }; my $cfgdatabase = { 'type' => 'config', - 'rootdn' => 'cn=config', - 'rootpw' => 'secret' + 'rootdn' => 'cn=config' }; @schema = ( "core", "cosine", "inetorgperson" ); - push @databases, ( $cfgdatabase, $database ); - SCR->Execute('.ldapserver.initGlobals' ); SCR->Execute('.ldapserver.initSchema', \@schema ); - SCR->Execute('.ldapserver.initDatabases', \@databases ); + SCR->Execute('.ldapserver.initDatabases', [ $cfgdatabase, $database ] ); + my $rc = SCR->Read('.ldapserver.databases'); + y2milestone("Databases: ". Data::Dumper->Dump([$rc])); + @databases = @{$rc}; return 1; } @@ -727,7 +732,14 @@ return $rc; } - +## + # Get all ldap-server settings from the first parameter + # (For use by autoinstallation.) + # @param hashalgorithm a string defining the hashing algorithm (can be one of + # "CRYPT", "SMD5", "SHA", "SSHA" and "PLAIN" + # @param cleartext the cleartext password + # @return The hashed password value (Format: {hashmethod}hashedpassword ) + # BEGIN { $TYPEINFO {HashPassword} = ["function", "string", "string", "string" ] ; } sub HashPassword { Modified: trunk/ldap-server/src/dialogs.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/dialogs.ycp?rev=…
============================================================================== --- trunk/ldap-server/src/dialogs.ycp (original) +++ trunk/ldap-server/src/dialogs.ycp Fri Jun 27 16:00:24 2008 @@ -329,26 +329,26 @@ else if( ret == `next ) { //validate/update rootpw - defaults["rootpw"] = (string)UI::QueryWidget( `id( `te_rootpw ), `Value ); - if ( defaults["rootpw"]:"" == "" ) + defaults["rootpw_clear"] = (string)UI::QueryWidget( `id( `te_rootpw ), `Value ); + if ( defaults["rootpw_clear"]:"" == "" ) { Popup::Error( _("Please enter a password for the Administrator user") ); continue; } - if( defaults["rootpw"]:"" != "" ) + if( defaults["rootpw_clear"]:"" != "" ) { - if( defaults["rootpw"]:"" != UI::QueryWidget( `id( `te_valid_rootpw ), `Value ) ) + if( defaults["rootpw_clear"]:"" != UI::QueryWidget( `id( `te_valid_rootpw ), `Value ) ) { /* error popup */ Popup::Error( _("Password validation failed.") ); - defaults["rootpw"] = ""; + defaults["rootpw_clear"] = ""; continue; } } //update enctype string enctype = (string)UI::QueryWidget( `id( `cmb_cryptmethod ), `Value ); y2debug( "changing enctype to %1", enctype ); -// LdapServerConf::enctype = enctype; + defaults["pwenctype"] = enctype; //update Base DN defaults["basedn"] = (string)UI::QueryWidget( `id( `te_basedn ), `Value ); -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48645 - /trunk/ldap-server/src/agent/SlapdConfigAgent.cc
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:20 2008 New Revision: 48645 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48645&view=rev
Log: Don't crash on missing keys in the db-Maps Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:00:20 2008 @@ -199,10 +199,26 @@ { boost::shared_ptr<OlcBdbDatabase> db(new OlcBdbDatabase() ); db->setIndex(i); - db->setSuffix(dbMap->value(YCPString("suffix"))->asString()->value_cstr()); - db->setRootDn(dbMap->value(YCPString("rootdn"))->asString()->value_cstr()); - db->setDirectory(dbMap->value(YCPString("directory"))->asString()->value_cstr()); -// db->setRootPw(dbMap->value(YCPString("rootpw"))->asString()->toString()); + YCPMapIterator j = dbMap.begin(); + for ( ; j != dbMap.end(); j++ ) + { + if ( std::string("suffix") == j.key()->asString()->value_cstr() ) + { + db->setSuffix( j.value()->asString()->value_cstr() ); + } + else if (std::string("rootdn") == j.key()->asString()->value_cstr() ) + { + db->setRootDn( j.value()->asString()->value_cstr() ); + } + else if (std::string("rootpw") == j.key()->asString()->value_cstr() ) + { + db->setRootPw( j.value()->asString()->value_cstr() ); + } + else if (std::string("directory") == j.key()->asString()->value_cstr() ) + { + db->setDirectory( j.value()->asString()->value_cstr() ); + } + } databases.push_back(db); } else @@ -210,9 +226,22 @@ y2error("Database Type \"%s\" not supported. Trying to use generic Database class", dbtype.c_str()); boost::shared_ptr<OlcDatabase> db(new OlcDatabase(dbtype.c_str()) ); db->setIndex(i); -// db->setSuffix(dbMap->value(YCPString("suffix"))->asString()->value_cstr()); - db->setRootDn(dbMap->value(YCPString("rootdn"))->asString()->value_cstr()); - db->setRootPw(dbMap->value(YCPString("rootpw"))->asString()->value_cstr()); + YCPMapIterator j = dbMap.begin(); + for ( ; j != dbMap.end(); j++ ) + { + if ( std::string("suffix") == j.key()->asString()->value_cstr() ) + { + db->setSuffix( j.value()->asString()->value_cstr() ); + } + else if (std::string("rootdn") == j.key()->asString()->value_cstr() ) + { + db->setRootDn( j.value()->asString()->value_cstr() ); + } + else if (std::string("rootpw") == j.key()->asString()->value_cstr() ) + { + db->setRootPw( j.value()->asString()->value_cstr() ); + } + } databases.push_back(db); } } -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48644 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc complex.ycp wizards.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:17 2008 New Revision: 48644 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48644&view=rev
Log: Reworked migration wizard (slapd.conf -> back-config) Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/agent/SlapdConfigAgent.cc trunk/ldap-server/src/complex.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?re…
============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Fri Jun 27 16:00:17 2008 @@ -34,6 +34,7 @@ my $slapdConfChanged = 0; my $serviceEnabled = 0; my $registerSlp = 0; +my $useLdapiForConfig = 0; my %dbDefaults = (); my @databases = (); @@ -304,6 +305,15 @@ y2milestone(); return 0; } + +BEGIN { $TYPEINFO {UseLdapiForConfig} = ["function", "boolean", "boolean"]; } +sub UseLdapiForConfig +{ + my $self = shift; + $useLdapiForConfig = shift; + return 1; +} + BEGIN { $TYPEINFO {ReadServiceEnabled} = ["function", "boolean"]; } sub ReadServiceEnabled { y2milestone("ReadServiceEnabled $serviceEnabled"); @@ -347,7 +357,6 @@ { my $self = shift; my ( $msg, $details ) = @_; - y2milestone("Error: $msg, $details"); $error{'msg'} = $msg; $error{'details'} = $details; } @@ -424,8 +433,10 @@ my $self = shift; my $progressItems = [ _("Cleaning up directory for config database"), _("Converting slapd.conf to config database"), - _("Switching startup configuration to use config database")]; + _("Switching startup configuration to use config database"), + _("Restarting LDAP Server") ]; Progress->New("Migrating LDAP Server Configuration", "Blub", 3, $progressItems, $progressItems, ""); + Progress->NextStage(); Progress->NextStage(); @@ -448,6 +459,37 @@ Progress->Finish(); return 0; } + if ( $useLdapiForConfig ) + { + $rc = SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'yes'); + if ( ! $rc ) + { + y2error("Error while enabling LDAPI listener"); + $self->SetError( _("Enabling LDAPI listener failed.") ); + Progress->Finish(); + return 0; + } + $rc = SCR->Execute('.ldapserver.addRootSaslRegexp'); + if ( ! $rc ) + { + y2error("Error while creating SASL Auth mapping for \"root\"."); + $self->SetError( _("Enabling LDAPI listener failed.") ); + Progress->Finish(); + return 0; + } + } + # FIXME: + # Explicit cache flush, see bnc#350581 for details + SCR->Write(".sysconfig.openldap", undef); + Progress->NextStage(); + $rc = Service->Restart("ldap"); + if (! $rc ) + { + y2error("Error while starting the LDAP service"); + $self->SetError( _("Starting the LDAP service failed.") ); + Progress->Finish(); + return 0; + } Progress->Finish(); return 1; } Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:00:17 2008 @@ -240,6 +240,35 @@ } } } + else if ( path->component_str(0) == "addRootSaslRegexp" ) + { + std::string filename = "/etc/openldap/slapd.d/cn=config.ldif"; + std::ifstream ldifFile(filename.c_str()); + try { + LdifReader ldif(ldifFile); + if ( ldif.readNextRecord() ) + { + LDAPEntry entry, oldEntry; + entry = ldif.getEntryRecord(); + entry.addAttribute( + LDAPAttribute( "olcAuthzRegexp", + "gidNumber=0\\+uidNumber=0,cn=peercred,cn=external,cn=auth dn:cn=config") + ); + ldifFile.close(); + std::ofstream oldifFile(filename.c_str(), std::ios::out|std::ios::trunc); + LdifWriter oldif(oldifFile); + oldif.writeRecord(entry); + oldifFile.close(); + } + return YCPBoolean(true); + } catch ( std::runtime_error e ) { + lastError->add(YCPString("summary"), + YCPString("Error while parsing LDIF file") ); + lastError->add(YCPString("description"), + YCPString(std::string( e.what() ) ) ); + return YCPBoolean(false); + } + } return YCPBoolean(true); } Modified: trunk/ldap-server/src/complex.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/complex.ycp?rev=…
============================================================================== --- trunk/ldap-server/src/complex.ycp (original) +++ trunk/ldap-server/src/complex.ycp Fri Jun 27 16:00:17 2008 @@ -162,6 +162,88 @@ string configFile = "/etc/openldap/slapd.conf"; if ( !hasBackconfig && configModified ) { + return `migrate; + + } + else if (! configModified ) + { + // Start new config wizward + LdapServer::InitDbDefaults(); + return `initial; + } + + return `next; +} + +symbol MigrationMainDialog() +{ + string caption = "Migrate existing Configuration"; + string summary = _("Your system is currently configured to use the configuration +file /etc/openldap/slapd.conf. This YaST module does only support the dynamich +configuration database of OpenLDAP (back-config). Do you want to migrate your +existing configuration to the configuration database?"); + term contents = + `VBox( + `HSquash( + `RadioButtonGroup( + `id( `rb ), + `VBox( + `Label( summary ), + `Left( + `RadioButton( `id( 0 ), _("Migrate existing configuration"), true ) + ), + `Left( + `RadioButton( `id( 1 ), _("Create a new configuration from scratch") ) + ) + ) + ) + ) + ); + + Wizard::SetContentsButtons(caption, contents, HELPS["summary"]:"", + Label::BackButton(), Label::NextButton()); + symbol ret = `next; + while(true) { + ret = (symbol)UI::UserInput(); + + /* abort? */ + if (ret == `abort || ret == `cancel ) + { + if(ReallyAbort()) + { + break; + } + else + { + continue; + } + } + else if ( ret == `next ) + { + integer current = (integer) UI::QueryWidget(`id(`rb), `CurrentButton); + if ( current == 0 ) + { + ret = `next; + } + else + { + ret = `initial; + } + break; + } + else if ( ret == `back ) + { + break; + } + else { + y2error("unexpected retcode: %1", ret); + continue; + } + } + + return ret; + +/* switchToBackConfig = Popup::ContinueCancelHeadline( _("Convert to \"Back-Config\"?"), _("Your system is currently configured to use the configuration file /etc/openldap/slapd.conf. This YaST @@ -193,17 +275,126 @@ { return `abort; } +*/ +} + +symbol MigrationDialog() +{ + string caption = "Migrate existing Configuration"; + string summary = _("In order to access the server configration after the migration you need +to configure how YaST should authenticate against the configuration database."); + list enc_types = [ + `item( `id( "CRYPT" ), "CRYPT" ), + `item( `id( "SMD5" ), "SMD5" ), + `item( `id( "SHA" ), "SHA" ), + `item( `id( "SSHA" ), "SSHA", true ), + `item( `id( "PLAIN" ), "PLAIN" ) + ]; + term contents = + `VBox( + `HSquash( + `RadioButtonGroup( `id( `rb ), + `VBox( + `Label( summary ), + `Left( + `RadioButton( `id( `rb_ldapi ), `opt(`notify), + _("Access the Server via LDAP over Unix Domain Sockets (ldapi) +and give \"root\" full access to the configuration."), true ) + ), + `Left( + `RadioButton( `id( `rb_passwd ), `opt(`notify), + _("Use a \"normal\" encrypted LDAP connection with LDAP +simple authentication.") ) + ), + `Left( + `Label( `id( `lab_pw ), _("Please set a password of the configuration user (cn=config)") ) + ), + `Password( `id( `te_rootpw ), _("New &Password") ), + `HSpacing( 0.5 ), + `Password( `id( `te_valid_rootpw ), _("&Validate Password") ), + `HSpacing( 0.5 ), + `ComboBox( `id( `cb_cryptmethod ), _("Password &Encryption"), enc_types ) + ) + ) + ) + ); + + Wizard::SetContentsButtons(caption, contents, HELPS["summary"]:"", + Label::BackButton(), Label::NextButton()); + + UI::ChangeWidget( `lab_pw , `Enabled, false ); + UI::ChangeWidget( `te_rootpw , `Enabled, false ); + UI::ChangeWidget( `te_valid_rootpw , `Enabled, false ); + UI::ChangeWidget( `cb_cryptmethod , `Enabled, false ); + symbol ret = `next; + while(true) { + ret = (symbol)UI::UserInput(); + + /* abort? */ + if (ret == `abort || ret == `cancel ) + { + if(ReallyAbort()) + { + break; + } + else + { + continue; + } + } + else if ( ret == `next ) + { + symbol current = (symbol) UI::QueryWidget(`id(`rb), `CurrentButton); + if ( current == `rb_ldapi ) + { + LdapServer::UseLdapiForConfig( true ); + ret = `next; + } + else + { + ret = `initial; + } + break; + } + else if ( ret == `back ) + { + break; + } + else if ( ret == `rb_ldapi ) + { + UI::ChangeWidget( `lab_pw , `Enabled, false ); + UI::ChangeWidget( `te_rootpw , `Enabled, false ); + UI::ChangeWidget( `te_valid_rootpw , `Enabled, false ); + UI::ChangeWidget( `cb_cryptmethod , `Enabled, false ); + } + else if ( ret == `rb_passwd ) + { + UI::ChangeWidget( `lab_pw , `Enabled, true ); + UI::ChangeWidget( `te_rootpw , `Enabled, true ); + UI::ChangeWidget( `te_valid_rootpw , `Enabled, true ); + UI::ChangeWidget( `cb_cryptmethod , `Enabled, true ); + } + else + { + y2error("unexpected retcode: %1", ret); + continue; + } } - else if (! configModified ) + + return ret; +} + +symbol DoMigration() +{ + if (! LdapServer::MigrateSlapdConf()) { - // Start new config wizward - LdapServer::InitDbDefaults(); - return `initial; + y2milestone("LdapServer::MigrateSlapdConf failed"); + DisplayError( LdapServer::GetError() ); + return `abort; } - + LdapServer::Read(); return `next; } - /** * Write settings dialog * @return `abort if aborted and `next otherwise @@ -234,7 +425,7 @@ term contents = `VBox( `RichText( summary ), - `Right( + `Right( `PushButton( `id(`pb_advanced), _("Advanced Configuration") ) ) ); Modified: trunk/ldap-server/src/wizards.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/wizards.ycp?rev=…
============================================================================== --- trunk/ldap-server/src/wizards.ycp (original) +++ trunk/ldap-server/src/wizards.ycp Fri Jun 27 16:00:17 2008 @@ -101,6 +101,51 @@ return ret; } +any MigrateSequence() { + + /* Initialization dialog caption */ + string caption = _("LDAP Server Configuration"); + /* Initialization dialog contents */ + term contents = `Label(_("Initializing...")); + + + map aliases = $[ + "startup" : ``( MigrationMainDialog() ), + "proposal" : ``( ProposalSequence() ), + "authconfig" : ``( MigrationDialog() ), + "migrate" : ``( DoMigration() ) + ]; + + map sequence = $[ + "ws_start" : "startup", + "startup" : $[ + `abort : `abort, + `next : "authconfig", + `initial : "proposal" + ], + "authconfig" : $[ + `next : "migrate" + ], + "migrate" : $[ + `next : `next + ], + "proposal" : $[ + `next : `next + ] + ]; + + y2milestone( "--> starting MigrateSequence" ); + + Wizard::CreateDialog(); + any ret = Sequencer::Run(aliases, sequence); + + y2milestone( "--> MigrateSequence finished " ); + + UI::CloseDialog(); + + return ret; +} + /** * Whole configuration of ldap-server * @return sequence result @@ -109,6 +154,7 @@ map aliases = $[ "read" : ``( ReadDialog() ), + "migrate" : ``( MigrateSequence() ), "propose" : ``( ProposalSequence() ), "main" : ``( MainSequence() ), "write" : ``( WriteDialog() ) @@ -119,8 +165,14 @@ "read" : $[ `abort : `abort, `initial : "propose", + `migrate : "migrate", `next : "main" ], + "migrate" : $[ + `abort : `abort, + `initial : "propose", + `next : "main" + ], "propose" : $[ `next : `next, `abort : `abort -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48643 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.h lib/Makefile.am lib/backConfigTest.cpp lib/backConfigTest.h lib/slapd-config.cpp lib/slapd-config.h
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:13 2008 New Revision: 48643 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48643&view=rev
Log: Rename backConfigTest -> slapd-config Added: trunk/ldap-server/src/lib/slapd-config.cpp - copied, changed from r48642, trunk/ldap-server/src/lib/backConfigTest.cpp trunk/ldap-server/src/lib/slapd-config.h - copied, changed from r48642, trunk/ldap-server/src/lib/backConfigTest.h Removed: trunk/ldap-server/src/lib/backConfigTest.cpp trunk/ldap-server/src/lib/backConfigTest.h Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.h trunk/ldap-server/src/lib/Makefile.am Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.h URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.h (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.h Fri Jun 27 16:00:13 2008 @@ -11,7 +11,7 @@ #include <Y2.h> #include <scr/SCRAgent.h> #include <boost/shared_ptr.hpp> -#include "backConfigTest.h" +#include "slapd-config.h" /** * @short An interface class between YaST2 and Ldap Agent */ Modified: trunk/ldap-server/src/lib/Makefile.am URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/Makefile.am?…
============================================================================== --- trunk/ldap-server/src/lib/Makefile.am (original) +++ trunk/ldap-server/src/lib/Makefile.am Fri Jun 27 16:00:13 2008 @@ -1,8 +1,8 @@ lib_LTLIBRARIES = libslapdconfig.la -libslapdconfig_la_SOURCES = backConfigTest.cpp +libslapdconfig_la_SOURCES = slapd-config.cpp -include_HEADERS = backConfigTest.h +include_HEADERS = slapd-config.h libslapdconfig_la_LIBADD = -lldapcpp libslapdconfig_la_LDFLAGS = -version-info 0:1:0 Copied: trunk/ldap-server/src/lib/slapd-config.cpp (from r48642, trunk/ldap-server/src/lib/backConfigTest.cpp) URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.cpp (original) +++ trunk/ldap-server/src/lib/slapd-config.cpp Fri Jun 27 16:00:13 2008 @@ -7,7 +7,7 @@ #include <vector> #include <LDAPEntry.h> #include <LdifWriter.h> -#include "backConfigTest.h" +#include "slapd-config.h" static bool nocase_compare( char c1, char c2){ return toupper(c1) == toupper(c2); Copied: trunk/ldap-server/src/lib/slapd-config.h (from r48642, trunk/ldap-server/src/lib/backConfigTest.h) URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
============================================================================== (empty) -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48642 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc lib/backConfigTest.cpp lib/backConfigTest.h
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:08 2008 New Revision: 48642 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48642&view=rev
Log: fixed creation of new password overlays Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc trunk/ldap-server/src/lib/backConfigTest.cpp trunk/ldap-server/src/lib/backConfigTest.h Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:00:08 2008 @@ -222,6 +222,11 @@ if ( globals ) olc.updateEntry( *globals ); + OlcSchemaList::const_iterator j; + for ( j = schema.begin(); j != schema.end() ; j++ ) + { + olc.updateEntry(**j); + } OlcDatabaseList::const_iterator i; for ( i = databases.begin(); i != databases.end() ; i++ ) { @@ -230,14 +235,10 @@ OlcOverlayList::const_iterator k; for ( k = overlays.begin(); k != overlays.end(); k++ ) { + y2milestone("Update overlay: %s", (*k)->getDn().c_str() ); olc.updateEntry(**k); } } - OlcSchemaList::const_iterator j; - for ( j = schema.begin(); j != schema.end() ; j++ ) - { - olc.updateEntry(**j); - } } return YCPBoolean(true); } @@ -745,34 +746,47 @@ { if ( (*j)->getType() == "ppolicy" ) { - YCPMap argMap = arg->asMap(); - y2milestone("Mapsize: %d", argMap.size()); - if ( argMap.size() == 0 ){ - y2milestone("Delete ppolicy overlay"); - (*j)->clearChangedEntry(); - } else { - (*j)->setStringValue("olcPpolicyDefault", - argMap->value(YCPString("defaultPolicy"))->asString()->value_cstr() ); - if ( argMap->value(YCPString("useLockout"))->asBoolean()->value() == true ) - { - (*j)->setStringValue("olcPpolicyUseLockout", "TRUE"); - } - else - { - (*j)->setStringValue("olcPpolicyUseLockout", "FALSE"); - } - if ( argMap->value(YCPString("hashClearText"))->asBoolean()->value() == true ) - { - (*j)->setStringValue("olcPpolicyHashCleartext", "TRUE"); - } - else - { - (*j)->setStringValue("olcPpolicyHashCleartext", "FALSE"); - } - } break; } } + boost::shared_ptr<OlcOverlay> ppolicyOlc; + if ( j == overlays.end() ) + { + y2milestone("New Overlay added"); + boost::shared_ptr<OlcOverlay> tmp(new OlcOverlay("ppolicy", (*i)->getDn())); + ppolicyOlc = tmp; + (*i)->addOverlay(ppolicyOlc); + } + else + { + y2milestone("Update existing Overlay"); + ppolicyOlc = *j; + } + YCPMap argMap = arg->asMap(); + y2milestone("Mapsize: %d", argMap.size()); + if ( argMap.size() == 0 ){ + y2milestone("Delete ppolicy overlay"); + ppolicyOlc->clearChangedEntry(); + } else { + ppolicyOlc->setStringValue("olcPpolicyDefault", + argMap->value(YCPString("defaultPolicy"))->asString()->value_cstr() ); + if ( argMap->value(YCPString("useLockout"))->asBoolean()->value() == true ) + { + ppolicyOlc->setStringValue("olcPpolicyUseLockout", "TRUE"); + } + else + { + ppolicyOlc->setStringValue("olcPpolicyUseLockout", "FALSE"); + } + if ( argMap->value(YCPString("hashClearText"))->asBoolean()->value() == true ) + { + ppolicyOlc->setStringValue("olcPpolicyHashCleartext", "TRUE"); + } + else + { + ppolicyOlc->setStringValue("olcPpolicyHashCleartext", "FALSE"); + } + } ret = true; } else Modified: trunk/ldap-server/src/lib/backConfigTest.cpp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTe…
============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.cpp (original) +++ trunk/ldap-server/src/lib/backConfigTest.cpp Fri Jun 27 16:00:08 2008 @@ -567,6 +567,16 @@ entryIndex = splitIndexFromString( type, m_type ); } +OlcOverlay::OlcOverlay( const std::string &type, const std::string &parent ) + : m_type(type) +{ + std::ostringstream dnstr; + dnstr << "olcOverlay=" << m_type << "," << parent; + m_dbEntryChanged.setDN(dnstr.str()); + m_dbEntryChanged.addAttribute(LDAPAttribute("objectclass", "olcPpolicyConfig")); + m_dbEntryChanged.addAttribute(LDAPAttribute("olcoverlay", m_type)); +} + const std::string OlcOverlay::getType() const { return m_type; Modified: trunk/ldap-server/src/lib/backConfigTest.h URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTe…
============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.h (original) +++ trunk/ldap-server/src/lib/backConfigTest.h Fri Jun 27 16:00:08 2008 @@ -82,6 +82,7 @@ public: static OlcOverlay* createFromLdapEntry( const LDAPEntry& le); OlcOverlay( const LDAPEntry &le ); + OlcOverlay( const std::string &type, const std::string &parent ); const std::string getType() const; protected: -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
[yast-commit] r48641 - /trunk/ldap-server/agents/ag_ldapserver
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:04 2008 New Revision: 48641 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48641&view=rev
Log: remove old perl-based ldapserver-agent Removed: trunk/ldap-server/agents/ag_ldapserver -- To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200