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
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 -----
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] r48660 - in /trunk/ldap-server/src: tree_structure.ycp widgets.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:01:17 2008 New Revision: 48660 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48660&view=rev
Log: Provide differnt views for differnt types of databases Modified: trunk/ldap-server/src/tree_structure.ycp trunk/ldap-server/src/widgets.ycp Modified: trunk/ldap-server/src/tree_structure.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.y…
============================================================================== --- trunk/ldap-server/src/tree_structure.ycp (original) +++ trunk/ldap-server/src/tree_structure.ycp Fri Jun 27 16:01:17 2008 @@ -1214,7 +1214,7 @@ map<string,any> item_map = $[ "name" : label, "index" : index, - "widget" : editBdbDatabase, + "widget" : editGenericDatabase, "new_db" : new_db, "dynamic" : true, "help_page" : "database_detail", Modified: trunk/ldap-server/src/widgets.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/widgets.ycp?rev=…
============================================================================== --- trunk/ldap-server/src/widgets.ycp (original) +++ trunk/ldap-server/src/widgets.ycp Fri Jun 27 16:01:17 2008 @@ -322,6 +322,14 @@ generalDbWidget ) ); + term editGenericDatabase = + `Top( + `VBox( + `Heading( _("Edit Database") ), + `VSpacing( 1 ), + `Label( _("Databasetype not supported currently") ) + ) + ); term editBdbIndexes = `VBox( -- 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] r48659 - /trunk/ldap-server/src/ldap-server_auto.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:01:14 2008 New Revision: 48659 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48659&view=rev
Log: AutoYaST support doesn't work currently Modified: trunk/ldap-server/src/ldap-server_auto.ycp Modified: trunk/ldap-server/src/ldap-server_auto.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/ldap-server_auto…
============================================================================== --- trunk/ldap-server/src/ldap-server_auto.ycp (original) +++ trunk/ldap-server/src/ldap-server_auto.ycp Fri Jun 27 16:01:14 2008 @@ -44,7 +44,7 @@ /* Create a summary*/ if(func == "Summary") { - ret = (LdapServer::Summary())[0]:""; + ret = LdapServer::Summary(); } /* Reset configuration */ else if (func == "Reset") { @@ -95,7 +95,7 @@ * return boolean */ else if (func == "SetModified") { - LdapServer::SetModified (true); + //LdapServer::SetModified (true); ret = true; } -- 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] r48658 - in /trunk/ldap-server: configure.in.in src/agent/Makefile.am src/lib/Makefile.am yast2-ldap-server.spec.in
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:01:10 2008 New Revision: 48658 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48658&view=rev
Log: fixed RPM building Modified: trunk/ldap-server/configure.in.in trunk/ldap-server/src/agent/Makefile.am trunk/ldap-server/src/lib/Makefile.am trunk/ldap-server/yast2-ldap-server.spec.in Modified: trunk/ldap-server/configure.in.in URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/configure.in.in?rev=…
============================================================================== --- trunk/ldap-server/configure.in.in (original) +++ trunk/ldap-server/configure.in.in Fri Jun 27 16:01:10 2008 @@ -16,6 +16,11 @@ if [[ "$yast_found_ldapcpplib" = "no" ]]; then AC_MSG_ERROR(Headers for ldapcpplib are missing. Please install the package ldapcpplib-devel.) fi +yast_found_boost=no +AC_CHECK_HEADER(boost/shared_ptr.hpp,[yast_found_boost=yes]) +if [[ "$yast_found_boost" = "no" ]]; then + AC_MSG_ERROR(Boost Headers are missing. Please install the package boost-devel.) +fi AC_LANG_POP(C++) ## and generate the output... Modified: trunk/ldap-server/src/agent/Makefile.am URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/Makefile.a…
============================================================================== --- trunk/ldap-server/src/agent/Makefile.am (original) +++ trunk/ldap-server/src/agent/Makefile.am Fri Jun 27 16:01:10 2008 @@ -14,7 +14,8 @@ libpy2ag_slapdconfig_la_SOURCES = \ $(liby2ag_slapdconfig_la_SOURCES) \ - Y2CCSlapdConfigAgent.cc #Y2CCLdapAgent.h + Y2CCSlapdConfigAgent.cc + libpy2ag_slapdconfig_la_LDFLAGS = -version-info 2:0 libpy2ag_slapdconfig_la_LIBADD = ../lib/libslapdconfig.la @AGENT_LIBADD@ -L$(libdir) 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:01:10 2008 @@ -2,7 +2,7 @@ libslapdconfig_la_SOURCES = slapd-config.cpp -include_HEADERS = slapd-config.h +noinst_HEADERS = slapd-config.h libslapdconfig_la_LIBADD = -lldapcpp libslapdconfig_la_LDFLAGS = -version-info 0:1:0 Modified: trunk/ldap-server/yast2-ldap-server.spec.in URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/yast2-ldap-server.sp…
============================================================================== --- trunk/ldap-server/yast2-ldap-server.spec.in (original) +++ trunk/ldap-server/yast2-ldap-server.spec.in Fri Jun 27 16:01:10 2008 @@ -1,11 +1,9 @@ @HEADER-COMMENT@ @HEADER@ -BuildRequires: perl-XML-Writer pkg-config update-desktop-files yast2 yast2-core yast2-devtools +BuildRequires: pkg-config update-desktop-files yast2 yast2-core-devel yast2-devtools libldapcpp-devel boost-devel gcc-c++ Requires: acl yast2 yast2-users yast2-ldap-client yast2-network perl perl-gettext yast2-perl-bindings yast2-ca-management perl-X500-DN perl-Digest-SHA1 net-tools -BuildArchitectures: noarch - Summary: Configuration of the OpenLDAP server %description @@ -16,6 +14,8 @@ @BUILD@ @INSTALL@ +rm -f $RPM_BUILD_ROOT/%{_libdir}/libslapdconfig.la +rm -f $RPM_BUILD_ROOT/%{_libdir}/libslapdconfig.so @CLEAN@ @@ -23,13 +23,14 @@ %defattr(-,root,root) %dir @yncludedir@/ldap-server %dir @moduledir@/YaPI +%{_libdir}/libslapdconfig.so.* @yncludedir@/ldap-server/* @clientdir@/ldap-server.ycp @clientdir@/ldap-server_*.ycp @moduledir@/LdapServer.* @moduledir@/YaPI/LdapServer.pm @desktopdir@/ldap-server.desktop +@plugindir@/libpy2ag_slapdconfig.* @schemadir@/autoyast/rnc/ldap-server.rnc @scrconfdir@/* -@agentdir@/* %doc @docdir@ -- 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] r48657 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc 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:01:06 2008 New Revision: 48657 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48657&view=rev
Log: Implement logging callback, get rid of stderr/stdout logging Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc trunk/ldap-server/src/lib/slapd-config.cpp trunk/ldap-server/src/lib/slapd-config.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:01:06 2008 @@ -46,9 +46,17 @@ return toupper(c1) == toupper(c2); } + +static void y2LogCallback( int level, const std::string &msg, + const char* file=0, const int line=0, const char* function=0) +{ + y2_logger(LOG_MILESTONE, "libslapdconfig", file, line, function, "%s", msg.c_str()); +} + SlapdConfigAgent::SlapdConfigAgent() { y2milestone("SlapdConfigAgent::SlapdConfigAgent"); + OlcConfig::setLogCallback(y2LogCallback); // LDAPConnection *lc = new LDAPConnection("ldap://localhost"); // lc->bind("cn=config", "secret"); // olc = OlcConfig(lc); 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:01:06 2008 @@ -1,3 +1,13 @@ +/* + * slapd-config.cpp + * + * A library for accessing OpenLDAP's configuration backend + * + * Author: Ralf Haferkamp <rhafer(a)suse.de> + * + * $Id$ + */ + #include <LDAPConnection.h> #include <LDAPResult.h> #include <string> @@ -9,6 +19,19 @@ #include <LdifWriter.h> #include "slapd-config.h" + + +static void defaultLogCallback( int level, const std::string &msg, + const char* file=0, const int line=0, const char* function=0) +{ + std::cerr << msg << std::endl; +} + +SlapdConfigLogCallback *OlcConfig::logCallback = defaultLogCallback; + +#define log_it( level, string ) \ + OlcConfig::logCallback( level, string, __FILE__, __LINE__ , __FUNCTION__ ) + static bool nocase_compare( char c1, char c2){ return toupper(c1) == toupper(c2); } @@ -28,7 +51,6 @@ } return index; } - static bool strCaseIgnoreEquals(const std::string &s1, const std::string &s2) { if(s1.size() == s2.size()){ @@ -40,6 +62,7 @@ return false; } + OlcDatabase::OlcDatabase( const LDAPEntry& le=LDAPEntry()) : OlcConfigEntry(le) { std::string type(this->getStringValue("olcdatabase")); @@ -57,7 +80,7 @@ void OlcDatabase::updateEntryDn() { - std::cerr << "updateEntryDN()" << std::endl; + log_it(0, "updateEntryDN()"); std::ostringstream dn, name; name << "{" << entryIndex << "}" << m_type; dn << "olcDatabase=" << name.str() << ",cn=config" ; @@ -76,7 +99,7 @@ { std::string::size_type pos = indexString.find_first_of(" \t"); attr = indexString.substr(0, pos); - std::cout << "AttributeType: <" << attr << ">" << std::endl; + log_it( 0, "AttributeType: " + attr ); if ( pos != std::string::npos ) { pos = indexString.find_first_not_of(" \t", pos); if ( pos != std::string::npos ) { @@ -93,7 +116,7 @@ pos = indexes.find( ',', oldpos ); std::string index = indexes.substr( oldpos, (pos == std::string::npos ? std::string::npos : pos - oldpos) ); - std::cout << "Index: <" << index << ">" << std::endl; + log_it(0, std::string("Index: ") + index ); oldpos = indexes.find_first_not_of( ", ", pos ); if ( index == "pres" ) { idx.push_back(Present); @@ -133,7 +156,7 @@ std::string attrType; std::string indexes; splitIndexString(*i, attrType, indexes ); - std::cout << "Indexes: <" << indexes << ">" << std::endl; + log_it(0, "Indexes: " + indexes ); std::vector<IndexType> idx = indexString2Type(indexes); res.insert(make_pair(attrType, idx)); } @@ -190,7 +213,7 @@ indexString += "sub"; } } - std::cout << "indexString: '" << indexString << "'" << std::endl; + log_it(0, "indexString: '" + indexString + "'"); this->addStringValue( "olcDbIndex", indexString ); } @@ -263,7 +286,7 @@ OlcGlobalConfig::OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le) { - std::cout << "OlcGlobalConfig::OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le)" << std::endl; + log_it(0, "OlcGlobalConfig::OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le)"); } @@ -277,11 +300,11 @@ std::istringstream iss(*i); int intlogValue; if ( iss >> intlogValue ) { - std::cerr << "IntegerValue " << *i << std::endl; + log_it(0,"IntegerValue " + *i ); } else { - std::cerr << "StringValue " << *i << std::endl; + log_it(0,"StringValue " + *i ); lvls.push_back(*i); } } @@ -387,7 +410,7 @@ OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e) : OlcConfigEntry(e) { - std::cout << "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e) : OlcConfigEntry(e)" << std::endl; + log_it( 0, "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e) : OlcConfigEntry(e)"); std::string name(this->getStringValue("cn")); if ( name[0] == '{' ) { @@ -402,7 +425,7 @@ } OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e1, const LDAPEntry &e2) : OlcConfigEntry(e1, e2) { - std::cout << "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e) : OlcConfigEntry(e)" << std::endl; + log_it(0, "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e) : OlcConfigEntry(e)"); std::string name(this->getStringValue("cn")); entryIndex = splitIndexFromString( name, m_name ); } @@ -436,7 +459,7 @@ OlcTlsSettings OlcGlobalConfig::getTlsSettings() const { - std::cout << "OlcTlsSettings OlcGlobalConfig::getTlsSettings() const " << std::endl; + log_it(0, "OlcTlsSettings OlcGlobalConfig::getTlsSettings() const "); return OlcTlsSettings( *this ); } @@ -531,27 +554,27 @@ { if ( OlcConfigEntry::isGlobalEntry(e) ) { - std::cerr << "creating OlcGlobalConfig" << std::endl; + log_it(0,"creating OlcGlobalConfig" ); return new OlcGlobalConfig(e); } else if ( OlcConfigEntry::isScheamEntry(e) ) { - std::cerr << "creating OlcSchemaConfig" << std::endl; + log_it(0,"creating OlcSchemaConfig" ); return new OlcSchemaConfig(e); } else if ( OlcConfigEntry::isDatabaseEntry(e) ) { - std::cerr << "creating OlcDatabase" << std::endl; + log_it(0,"creating OlcDatabase" );; return OlcDatabase::createFromLdapEntry(e); } else if ( OlcConfigEntry::isOverlayEntry(e) ) { - std::cerr << "creating OlcOverlay" << std::endl; + log_it(0,"creating OlcOverlay"); return new OlcConfigEntry(e); } else { - std::cerr << "unknown Config Object" << std::endl; + log_it(0,"unknown Config Object" ); return 0; } } @@ -595,7 +618,7 @@ OlcOverlay::OlcOverlay( const LDAPEntry& e) : OlcConfigEntry(e) { - std::cerr << "OlcOverlay::OlcOverlay()" << std::endl; + log_it(0,"OlcOverlay::OlcOverlay()" ); std::string type(this->getStringValue("olcoverlay")); entryIndex = splitIndexFromString( type, m_type ); } @@ -718,12 +741,12 @@ { if ( OlcDatabase::isBdbDatabase( e ) ) { - std::cerr << "creating OlcBbdDatabase()" << std::endl; + log_it(0,"creating OlcBbdDatabase()" ); return new OlcBdbDatabase(e); } else { - std::cerr << "creating OlcDatabase()" << std::endl; + log_it(0,"creating OlcDatabase()" ); return new OlcDatabase(e); } } @@ -756,7 +779,7 @@ void OlcConfigEntry::setStringValue(const std::string &type, const std::string &value) { - std::cerr << "setStringValue() " << type << " " << value << std::endl; + log_it(0,"setStringValue() " + type + " " + value); if ( value.empty() ) { m_dbEntryChanged.delAttribute(type); @@ -821,11 +844,11 @@ LDAPModList OlcConfigEntry::entryDifftoMod() const { LDAPAttributeList::const_iterator i = m_dbEntry.getAttributes()->begin(); LDAPModList modifications; - std::cout << "Old Entry DN: " << m_dbEntry.getDN() << std::endl; - std::cout << "New Entry DN: " << m_dbEntryChanged.getDN() << std::endl; + log_it(0, "Old Entry DN: " + m_dbEntry.getDN()); + log_it(0,"New Entry DN: " + m_dbEntryChanged.getDN()); for(; i != m_dbEntry.getAttributes()->end(); i++ ) { - std::cout << i->getName() << std::endl; + log_it(0,i->getName()); const LDAPAttribute *changedAttr = m_dbEntryChanged.getAttributeByName(i->getName()); if ( changedAttr ) { StringList::const_iterator j = i->getValues().begin(); @@ -843,7 +866,7 @@ if ( deleted ) { delValues.add(*j); - std::cout << "Value deleted: " << *j << std::endl; + log_it(0,"Value deleted: " + *j ); } } j = changedAttr->getValues().begin(); @@ -853,7 +876,7 @@ StringList::const_iterator k = i->getValues().begin(); for( ; k != i->getValues().end(); k++ ) { if ( *k == *j ) { - std::cout << "Value unchanged: " << *k << std::endl; + log_it(0,"Value unchanged: " + *k ); added = false; break; } @@ -861,13 +884,13 @@ if ( added ) { addValues.add(*j); - std::cout << "Value added: " << *j << std::endl; + log_it(0,"Value added: " + *j); } } bool replace = false; if ( delValues.size() > 0 ) { if ( (addValues.size() > 0) && ( (int)delValues.size() == i->getNumValues()) ) { - std::cout << "All Values deleted, this is a replace" << std::endl; + log_it(0,"All Values deleted, this is a replace" ); modifications.addModification( LDAPModification( LDAPAttribute(i->getName(), addValues), LDAPModification::OP_REPLACE) @@ -887,7 +910,7 @@ ); } } else { - std::cout << "removed Attribute: " << i->getName() << std::endl; + log_it(0,"removed Attribute: " + i->getName() ); modifications.addModification( LDAPModification( LDAPAttribute(i->getName()), LDAPModification::OP_DELETE) @@ -897,10 +920,10 @@ i = m_dbEntryChanged.getAttributes()->begin(); for(; i != m_dbEntryChanged.getAttributes()->end(); i++ ) { - std::cout << i->getName() << std::endl; + log_it(0,i->getName() ); const LDAPAttribute *old = m_dbEntry.getAttributeByName(i->getName()); if (! old ) { - std::cout << "Attribute added: " << i->getName() << std::endl; + log_it(0,"Attribute added: " + i->getName()); if (! i->getValues().empty() ) { modifications.addModification( @@ -926,11 +949,11 @@ sr = m_lc->search( "cn=config", LDAPConnection::SEARCH_BASE); dbEntry = sr->getNext(); } catch (LDAPException e) { - std::cout << e << std::endl; + log_it(0, e.getResultMsg() + ": " + e.getServerMsg() ); throw; } if ( dbEntry ) { - std::cout << "Got GlobalConfig: " << dbEntry->getDN() << std::endl; + log_it(0,"Got GlobalConfig: " + dbEntry->getDN() ); boost::shared_ptr<OlcGlobalConfig> gc( new OlcGlobalConfig(*dbEntry) ); return gc; } @@ -944,7 +967,7 @@ LDAPModList ml = olcg.entryDifftoMod(); m_lc->modify( olcg.getDn(), &ml ); } catch (LDAPException e) { - std::cout << e << std::endl; + log_it(0, e.getResultMsg() + ": " + e.getServerMsg() ); throw; } } @@ -962,11 +985,11 @@ if ( ! ml.empty() ) { m_lc->modify( oce.getDn(), &ml ); } else { - std::cout << oce.getDn() << ": no changes" << std::endl; + log_it(0,oce.getDn() + ": no changes" ); } } } catch (LDAPException e) { - std::cout << e << std::endl; + log_it(0, e.getResultMsg() + e.getServerMsg() ); throw; } } @@ -981,21 +1004,21 @@ while ( (dbEntry = sr->getNext()) != 0 ) { std::string dbDn(dbEntry->getDN()); - std::cout << "Got Database Entry: " << dbDn << std::endl; + log_it(0,"Got Database Entry: " + dbDn); boost::shared_ptr<OlcDatabase> olce(OlcDatabase::createFromLdapEntry(*dbEntry)); LDAPSearchResults *overlaySearchRes = m_lc->search( dbDn, LDAPConnection::SEARCH_ONE, "objectclass=olcOverlayConfig" ); LDAPEntry *overlayEntry; while ( (overlayEntry = overlaySearchRes->getNext()) != 0 ) { - std::cout << "Got Overlay: " << overlayEntry->getDN() << std::endl; + log_it(0,"Got Overlay: " + overlayEntry->getDN() ); boost::shared_ptr<OlcOverlay> overlay(OlcOverlay::createFromLdapEntry(*overlayEntry) ); olce->addOverlay(overlay); } res.push_back(olce); } } catch (LDAPException e ) { - std::cout << e << std::endl; + log_it(0, e.getResultMsg() + e.getServerMsg() ); throw; } return res; @@ -1011,21 +1034,26 @@ LDAPEntry *entry; while ( entry = sr->getNext() ) { - std::cout << "Got Schema Entry: " << entry->getDN() << std::endl; + log_it(0,"Got Schema Entry: " + entry->getDN() ); boost::shared_ptr<OlcSchemaConfig> olce(new OlcSchemaConfig(*entry)); res.push_back(olce); } } catch (LDAPException e ) { - std::cout << e << std::endl; + log_it(0, e.getResultMsg() + e.getServerMsg() ); throw; } return res; } +void OlcConfig::setLogCallback( SlapdConfigLogCallback *lcb ) +{ + OlcConfig::logCallback = lcb; +} + OlcTlsSettings::OlcTlsSettings( const OlcGlobalConfig &ogc ) : m_crlCheck(0), m_verifyCient(0) { - std::cout << "OlcTlsSettings::OlcTlsSettings( const OlcGlobalConfig &ogc )" << std::endl; + log_it(0,"OlcTlsSettings::OlcTlsSettings( const OlcGlobalConfig &ogc )" ); std::string value = ogc.getStringValue("olcTLSCRLCheck"); if ( value == "none" ) { @@ -1066,7 +1094,7 @@ void OlcTlsSettings::applySettings( OlcGlobalConfig &ogc ) const { - std::cout << "OlcTlsSettings::applySettings( OlcGlobalConfig &ogc )" << std::endl; + log_it(0,"OlcTlsSettings::applySettings( OlcGlobalConfig &ogc )" ); ogc.setStringValue("olcTlsCaCertificatePath", m_caCertDir); ogc.setStringValue("olcTlsCaCertificateFile", m_caCertFile); ogc.setStringValue("olcTlsCertificateFile", m_certFile); @@ -1140,56 +1168,3 @@ m_crlFile = file; } -/* -int main(char** argv, int argc) -{ - LDAPConnection lc("localhost"); - LDAPSearchResults *sr; - LDAPEntry *dbEntry; - try { - lc.bind("cn=config","secret"); - sr = lc.search( "olcdatabase={1}bdb,cn=config", lc.SEARCH_BASE); - dbEntry = sr->getNext(); - } catch (LDAPException e) { - std::cout << e << std::endl; - exit(-1); - } - if ( dbEntry ) { - std::cout << "Got DBEntry: " << dbEntry->getDN() << std::endl; - OlcBdbDatabase db(*dbEntry); - OlcBdbDatabase::IndexMap idx = db.getDatabaseIndexes(); - OlcBdbDatabase::IndexMap::const_iterator i = idx.find("cn"); - - std::cout << "Idx: " << i->second[0] << " " << OlcBdbDatabase::Eq << std::endl; - } - try { - // read globalConfig - sr = lc.search( "cn=config", lc.SEARCH_BASE); - dbEntry = sr->getNext(); - } catch (LDAPException e) { - std::cout << e << std::endl; - exit(-1); - } - if ( dbEntry ) { - std::cout << "Got GlobalConfig: " << dbEntry->getDN() << std::endl; - OlcGlobalConfig gc(*dbEntry); -// gc.getLogLevel(); -// gc.setLogLevel("stats stats2"); - std::cout << "Config file: " << gc.getStringValue("olcConfigFile") << std::endl; - std::cout << "args file: " << gc.getStringValue("olcArgsFile") << std::endl; - gc.setStringValue("olcArgsFile", "/tmp/slapd.args" ); - try { - LDAPModList ml = gc.entryDifftoMod(); - lc.modify( dbEntry->getDN(), &ml ); - } catch (LDAPException e) { - std::cout << e << std::endl; - exit(-1); - } - } else { - std::cout << "no Entry" << std::endl; - } - - - -} -*/ 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:01:06 2008 @@ -1,3 +1,14 @@ +/* + * slapd-config.h + * + * A library for accessing OpenLDAP's configuration backend + * + * Author: Ralf Haferkamp <rhafer(a)suse.de> + * + * $Id$ + * + */ + #ifndef BACK_CONFIG_TEST_H #define BACK_CONFIG_TEST_H #include <LDAPConnection.h> @@ -11,6 +22,9 @@ #include <LDAPAttrType.h> #include <boost/shared_ptr.hpp> +typedef void (SlapdConfigLogCallback) (int level, const std::string &msg, + const char* file=0, const int line=0, const char* function=0 ); + class OlcConfigEntry { public: @@ -22,7 +36,9 @@ inline OlcConfigEntry() : m_dbEntry(), m_dbEntryChanged() {} inline OlcConfigEntry(const LDAPEntry& le) : m_dbEntry(le), m_dbEntryChanged(le) {} - inline OlcConfigEntry(const LDAPEntry& le, const LDAPEntry& le1) : m_dbEntry(le), m_dbEntryChanged(le1) {} + inline OlcConfigEntry(const LDAPEntry& le, const LDAPEntry& le1) + : m_dbEntry(le), m_dbEntryChanged(le1) {} + inline std::string getDn() const { return m_dbEntry.getDN(); } @@ -232,6 +248,9 @@ void setGlobals( OlcGlobalConfig &olcg); void updateEntry( const OlcConfigEntry &oce ); + static SlapdConfigLogCallback *logCallback; + static void setLogCallback( SlapdConfigLogCallback *lcb ); + private: LDAPConnection *m_lc; }; -- 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] r48656 - in /trunk/ldap-server: src/LdapServer.pm src/LdapServerConf.ycp src/Makefile.am src/dialogs.ycp src/ldap-server_proposal.ycp yast2-ldap-server.spec.in
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:01:01 2008 New Revision: 48656 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48656&view=rev
Log: - obsoleted LdapServerConf.ycp - adjust filesystem ACLs on Certificates Removed: trunk/ldap-server/src/LdapServerConf.ycp Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/Makefile.am trunk/ldap-server/src/dialogs.ycp trunk/ldap-server/src/ldap-server_proposal.ycp trunk/ldap-server/yast2-ldap-server.spec.in 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:01:01 2008 @@ -29,7 +29,8 @@ YaST::YCP::Import ("Service"); my %error = ( msg => undef, details => undef ); - +my $usingDefaults = 1; +my $configured = 0; my $usesBackConfig = 0; my $slapdConfChanged = 0; my $serviceEnabled = 0; @@ -398,6 +399,7 @@ SCR->Execute('.ldapserver.commitChanges' ); } sleep(1); + $configured = $ret; return $ret; } @@ -460,6 +462,17 @@ return (); } +BEGIN { $TYPEINFO{Configured} = ["function", "boolean"]; } +sub Configured +{ + return YaST::YCP::Boolean($configured); +} + +BEGIN { $TYPEINFO{UseDefaults} = ["function", "boolean"]; } +sub UseDefaults +{ + return YaST::YCP::Boolean($usingDefaults); +} ## # Return packages needed to be installed and removed during # Autoinstallation to insure module has all needed software @@ -513,8 +526,8 @@ return $registerSlp; } -BEGIN { $TYPEINFO {SetSlpEnabled} = ["function", "boolean", "boolean"]; } -sub SetSlpEnabled { +BEGIN { $TYPEINFO {SetSLPEnabled} = ["function", "boolean", "boolean"]; } +sub SetSLPEnabled { my $self = shift; y2milestone("SetSlpEnabled"); $registerSlp = shift; @@ -607,6 +620,31 @@ return 1; } +BEGIN { $TYPEINFO {SetTlsConfigCommonCert} = ["function", "boolean" ]; } +sub SetTlsConfigCommonCert +{ + my $self = shift; + my $ret = SCR->Execute(".target.bash", + "/usr/bin/setfacl -m u:ldap:r /etc/ssl/servercerts/serverkey.pem"); + if($ret != 0) { + return $self->SetError(_("Can not set a filesystem acl on the private key"), + "setfacl -m u:ldap:r /etc/ssl/servercerts/serverkey.pem failed.\n". + "Do you have filesystem acl support disabled?" ); + return 0; + } + + my $tlsSettings = { + "certKeyFile" => "/etc/ssl/servercerts/serverkey.pem", + "certFile" => "/etc/ssl/servercerts/servercert.pem", + "caCertFile" => "/etc/ssl/certs/YaST-CA.pem", + "caCertDir" => "", + "crlFile" => "", + "crlCheck" => 0, + "verifyClient" => 0 + }; + return $self->SetTlsConfig( $tlsSettings ); +} + BEGIN { $TYPEINFO {MigrateSlapdConf} = ["function", "boolean"]; } sub MigrateSlapdConf { @@ -683,6 +721,7 @@ $self->InitDbDefaults(); } y2milestone(Data::Dumper->Dump([\%dbDefaults])); + $usingDefaults = 1; return \%dbDefaults; } @@ -742,6 +781,7 @@ sub ReadFromDefaults { my $self = shift; + my $pwHash = $self->HashPassword($dbDefaults{'pwenctype'}, $dbDefaults{'rootpw_clear'} ); my $database = { 'type' => 'bdb', 'suffix' => $dbDefaults{'basedn'}, @@ -808,6 +848,7 @@ push @added_databases, { suffix => $dbDefaults{'basedn'}, rootdn => $dbDefaults{'rootdn'}, rootpw => $dbDefaults{'rootpw_clear'} }; + $usingDefaults = 0; return 1; } Modified: trunk/ldap-server/src/Makefile.am URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/Makefile.am?rev=…
============================================================================== --- trunk/ldap-server/src/Makefile.am (original) +++ trunk/ldap-server/src/Makefile.am Fri Jun 27 16:01:01 2008 @@ -21,8 +21,7 @@ ldap-server.desktop module_DATA = \ - LdapServer.pm \ - LdapServerConf.ycp + LdapServer.pm EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA) 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:01:01 2008 @@ -15,7 +15,6 @@ import "Label"; import "Wizard"; import "LdapServer"; -//import "LdapServerConf"; import "HTML"; import "DNS"; import "CaMgm"; @@ -298,13 +297,6 @@ Wizard::SetContentsButtons( caption, dlg_propose, HELPS["propose"]:"<p><b>no proposal help text</b></p>", Label::BackButton(), Label::NextButton() ); -// if( !LdapServerConf::proposal_changed ) -// { -// /* notify message */ -// Popup::Notify( _("Changing anything in this dialog disables the automatic -//generation of base DN, root DN, and LDAP password. -//") ); -// } if ( ! (boolean)defaults["serviceEnabled"]:false ) { UI::ChangeWidget( `id( `te_basedn ), `Enabled, false ); Modified: trunk/ldap-server/src/ldap-server_proposal.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/ldap-server_prop…
============================================================================== --- trunk/ldap-server/src/ldap-server_proposal.ycp (original) +++ trunk/ldap-server/src/ldap-server_proposal.ycp Fri Jun 27 16:01:01 2008 @@ -15,7 +15,6 @@ textdomain "ldap-server"; import "LdapServer"; -import "LdapServerConf"; import "Ldap"; import "HTML"; import "Label"; @@ -47,9 +46,9 @@ map <string,any> defaults = nil; - if( force_reset || !LdapServerConf::proposal_changed ) + if( force_reset || LdapServer::UseDefaults() ) { - if (force_reset && LdapServerConf::wroteDatabase) + if ( force_reset && LdapServer::Configured() ) { /* error popup */ Report::Warning( _("The LDAP database has already been created. You can change the settings later in the installed system.") ); @@ -88,7 +87,7 @@ warning = _("Unable to retrieve the system root password. Set an LDAP server password to continue."); warning_level = `blocker; } - // Try to get Firewall status + // Try to get Firewall status string fw_text = ""; if ( SuSEFirewall::GetEnableService()) { list<string> known_interfaces = SuSEFirewall::GetListOfKnownInterfaces(); @@ -124,7 +123,7 @@ _("LDAP Password: ") + rootPWString ] ) + _("Start LDAP Server: ") + HTML::Bold( _("YES") ) + HTML::Newline() + - _("Register at SLP Daemon: ") + HTML::Bold( LdapServerConf::registerSLP ? _("YES") : _("NO") ) + + _("Register at SLP Daemon: ") + HTML::Bold( LdapServer::ReadSLPEnabled() ? _("YES") : _("NO") ) + HTML::Newline() + fw_text; } else { @@ -142,7 +141,7 @@ else if(func == "AskUser") { map stored = nil; symbol seq = nil; - if( LdapServerConf::wroteDatabase ) + if( LdapServer::Configured() ) { /* error popup */ Report::Warning( _("The LDAP database has already been created. You can change the settings later in the installed system.") ); @@ -171,8 +170,7 @@ } /* write the proposal */ else if(func == "Write") { - if( LdapServerConf::wroteDatabase ) return ret; - LdapServerConf::wroteDatabase = true; + if( LdapServer::Configured() ) return ret; if( LdapServer::ReadServiceEnabled() ) { @@ -195,58 +193,20 @@ Progress::off(); LdapServer::ReadFromDefaults(); LdapServer::SetServiceEnabled( true ); -// LdapServer::WriteLoglevel( 0 ); + LdapServer::SetLogLevels( ["none"] ); Progress::on(); -// map ldap_defaults = Ldap::Export(); -// y2debug( "ldap settings map: %1", ldap_defaults ); -// -// //map bash_out = (map<string,any>)SCR::Execute( .target.bash_output, "/bin/hostname --long" ); -// //string fqdn = (string)bash_out["stdout"]:""; -// //fqdn = substring( fqdn, 0, size(fqdn)-1 ); -// -// ldap_defaults["ldap_server"] = "localhost"; -// ldap_defaults["base_config_dn"] = "ou=ldapconfig,"+LdapServerConf::baseDN; -// ldap_defaults["bind_dn"] = LdapServerConf::rootDN; -// ldap_defaults["ldap_domain"] = LdapServerConf::baseDN; -// ldap_defaults["ldap_tls"] = false; -// ldap_defaults["file_server"] = true; -// ldap_defaults["create_ldap"] = true; -// -// if( LdapServerConf::useCommonCA ) -// { -// if( !YaPI::LdapServer::CheckCommonServerCertificate() ) -// { -// /* Error popup */ -// Report::Error( _("OpenLDAP Server: Common server certificate not available. -//StartTLS is disabled.") ); -// LdapServerConf::useCommonCA = false; -// ldap_defaults["ldap_tls"] = false; -// } else -// { -// LdapServer::WriteConfigureCommonServerCertificate( true ); -// ldap_defaults["ldap_tls"] = true; -// } -// } -// -// LdapServer::WriteSLPEnabled( LdapServerConf::registerSLP ); -// -// LdapServer::AddDatabase( $[ "database":"bdb", -// "suffix": LdapServerConf::baseDN, -// "rootdn" : LdapServerConf::rootDN, -// "passwd" : LdapServerConf::rootPW, -// "cryptmethod" : LdapServerConf::enctype, -// "directory" : "/var/lib/ldap" -// ] ); -// y2debug( "ldap settings map after setting: %1", ldap_defaults ); -// Ldap::SetDefaults( ldap_defaults ); -// Ldap::SetBindPassword( LdapServerConf::rootPW ); -// } -// + if( !LdapServer::HaveCommonServerCertificate() ) + { + Report::Error( _("OpenLDAP Server: Common server certificate not available. +StartTLS is disabled.") ); + } + else + { + LdapServer::SetTlsConfigCommonCert(); + } + LdapServer::SetSLPEnabled( true ); LdapServer::Write(); } -// -// //be paranoid -// LdapServerConf::rootPW = ""; } /* unknown function */ else { Modified: trunk/ldap-server/yast2-ldap-server.spec.in URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/yast2-ldap-server.sp…
============================================================================== --- trunk/ldap-server/yast2-ldap-server.spec.in (original) +++ trunk/ldap-server/yast2-ldap-server.spec.in Fri Jun 27 16:01:01 2008 @@ -27,7 +27,6 @@ @clientdir@/ldap-server.ycp @clientdir@/ldap-server_*.ycp @moduledir@/LdapServer.* -@moduledir@/LdapServerConf.* @moduledir@/YaPI/LdapServer.pm @desktopdir@/ldap-server.desktop @schemadir@/autoyast/rnc/ldap-server.rnc -- 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] r48655 - /trunk/ldap-server/src/ldap-server_proposal.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:56 2008 New Revision: 48655 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48655&view=rev
Log: Made installation proposal working again Modified: trunk/ldap-server/src/ldap-server_proposal.ycp Modified: trunk/ldap-server/src/ldap-server_proposal.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/ldap-server_prop…
============================================================================== --- trunk/ldap-server/src/ldap-server_proposal.ycp (original) +++ trunk/ldap-server/src/ldap-server_proposal.ycp Fri Jun 27 16:00:56 2008 @@ -15,7 +15,6 @@ textdomain "ldap-server"; import "LdapServer"; -import "YaPI::LdapServer"; import "LdapServerConf"; import "Ldap"; import "HTML"; @@ -45,6 +44,7 @@ string warning = nil; symbol warning_level = nil; boolean force_reset = param["force_reset"]:false; + map <string,any> defaults = nil; if( force_reset || !LdapServerConf::proposal_changed ) @@ -59,65 +59,35 @@ if (!Package::Installed ("openldap2")) { y2milestone ("Openldap2 is not installed. --> service disabled"); - // LdapServer::WriteServiceEnabled (false); + LdapServer::SetServiceEnabled (false); } else { - //LdapServer::WriteServiceEnabled( true ); + LdapServer::SetServiceEnabled( true ); } - map bash_out = (map<string,any>)SCR::Execute( .target.bash_output, "/bin/hostname -d" ); - string domain = (string)bash_out["stdout"]:""; - domain = substring( domain, 0, size(domain)-1 ); - if (size (domain) <= 0) - { - domain = "site"; - } - y2milestone( "domain is '%1'", domain ); - list<string> dnlist = splitstring( domain, "." ); - y2milestone( "dnlist is '%1'", dnlist ); - string new_basedn = ""; - foreach( string dn, dnlist, { new_basedn = new_basedn + "dc=" + dn + ","; } ); - - LdapServerConf::baseDN = substring( new_basedn, 0, size( new_basedn )-1 ); - /* XXX: hack to resolve bug #44335: - * a failed 'hostname' causes the initial baseDN to be empty, thus the rootDN has a trailing comma. - * In dialogs.ycp, when the user enters a baseDN and leaves 'append Base DN' checked, another comma - * is put between rootDN and the baseDN part, leading to an invalid rootDN. To resolve this, the - * baseDN and comma is only appended to the initial rootDN if 'hostname' succeeded, that is, dnlist - * at least 1 element. - */ - //LdapServerConf::rootDN = "cn=Administrator,"+LdapServerConf::baseDN; - LdapServerConf::rootDN = "cn=Administrator"; - if( size( dnlist ) > 0 ) - { - LdapServerConf::rootDN = LdapServerConf::rootDN + "," + LdapServerConf::baseDN; - } - LdapServerConf::rootPW = Users::GetRootPassword(); - LdapServerConf::enctype = "SSHA"; - //LdapServer::WriteUseRootPW( true ); + defaults = LdapServer::GetInitialDefaults(); + defaults["rootpw_clear"] = Users::GetRootPassword(); + LdapServer::SetInitialDefaults(defaults); } } //y2error( "sysconfig var is '%1'", SCR::Read( .sysconfig.openldap.OPENLDAP_REGISTER_SLP ) ); - if( true ) // LdapServer::ReadServiceEnabled() ) + if( LdapServer::ReadServiceEnabled() ) { string rootPWString = ""; - if( LdapServerConf::rootPW == Users::GetRootPassword() ) + if( defaults["rootpw_clear"]:"" == Users::GetRootPassword() ) { - /*proposal password information*/ rootPWString = _("[root password]"); } else { - /*proposal password information*/ rootPWString = _("[manually set]"); } -// if( LdapServer::ReadUseRootPW() && Users::GetRootPassword() == "" ) -// { -// /* proposal error */ -// warning = _("Unable to retrieve the system root password. Set an LDAP server password to continue."); -// warning_level = `blocker; -// } + if( defaults["rootpw_clear"]:"" == "" ) + { + warning = _("Unable to retrieve the system root password. Set an LDAP server password to continue."); + warning_level = `blocker; + } // Try to get Firewall status string fw_text = ""; if ( SuSEFirewall::GetEnableService()) { @@ -149,8 +119,8 @@ } proposal = _("LDAP Server Configuration:") + HTML::Newline() + - HTML::List( [ _("Base DN: ") + LdapServerConf::baseDN, - _("Root DN: ") + LdapServerConf::rootDN, + HTML::List( [ _("Base DN: ") + defaults["basedn"]:"", + _("Root DN: ") + defaults["rootdn"]:"", _("LDAP Password: ") + rootPWString ] ) + _("Start LDAP Server: ") + HTML::Bold( _("YES") ) + HTML::Newline() + @@ -204,37 +174,29 @@ if( LdapServerConf::wroteDatabase ) return ret; LdapServerConf::wroteDatabase = true; -// if( LdapServer::ReadServiceEnabled() ) -// { -// /* ensure openldap2 package is installed */ -// if( !Package::Install( "openldap2" ) ) -// { -// if( !Package::Available( "openldap2" ) ) { -// // translators: error popup before aborting the module -// Popup::Error( sformat( _("The package '%1' is not available. -//YaST2 cannot continue the configuration -//without installing the package."), "openldap2" ) ); -// } else { -// // translators: error popup before aborting the module -// Popup::Error (_("YaST2 cannot continue the configuration -//without installing the required packages.")); -// } -// -// return ret; -// } -// } - - //string rootPW = ""; - + if( LdapServer::ReadServiceEnabled() ) + { + /* ensure openldap2 package is installed */ + if( !Package::Install( "openldap2" ) ) + { + if( !Package::Available( "openldap2" ) ) { + // translators: error popup before aborting the module + Popup::Error( sformat( _("The package '%1' is not available. +YaST2 cannot continue the configuration +without installing the package."), "openldap2" ) ); + } else { + // translators: error popup before aborting the module + Popup::Error (_("YaST2 cannot continue the configuration +without installing the required packages.")); + } -// if( LdapServer::ReadServiceEnabled() ) -// { -// Progress::off(); -// LdapServer::Read(); -// LdapServer::WriteServiceEnabled( true ); + return ret; + } + Progress::off(); + LdapServer::ReadFromDefaults(); + LdapServer::SetServiceEnabled( true ); // LdapServer::WriteLoglevel( 0 ); -// Ldap::Read(); -// Progress::on(); + Progress::on(); // map ldap_defaults = Ldap::Export(); // y2debug( "ldap settings map: %1", ldap_defaults ); // @@ -280,7 +242,8 @@ // Ldap::SetBindPassword( LdapServerConf::rootPW ); // } // -// LdapServer::Write(); + LdapServer::Write(); + } // // //be paranoid // LdapServerConf::rootPW = ""; -- 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] r48654 - /trunk/ldap-server/src/LdapServer.pm
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:54 2008 New Revision: 48654 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48654&view=rev
Log: improved logging 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?re…
============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Fri Jun 27 16:00:54 2008 @@ -516,7 +516,7 @@ BEGIN { $TYPEINFO {SetSlpEnabled} = ["function", "boolean", "boolean"]; } sub SetSlpEnabled { my $self = shift; - y2milestone("ReadServiceEnabled"); + y2milestone("SetSlpEnabled"); $registerSlp = shift; return 1; } @@ -768,24 +768,28 @@ my $rc = SCR->Write(".ldapserver.schema.addFromLdif", "/etc/openldap/schema/core.ldif" ); if ( ! $rc ) { my $err = SCR->Error(".ldapserver"); + y2error("Adding Schema failed: ".$err->{'summary'}." ".$err->{'description'}); $self->SetError( $err->{'summary'}, $err->{'description'} ); return $rc; } $rc = SCR->Write(".ldapserver.schema.addFromLdif", "/etc/openldap/schema/cosine.ldif" ); if ( ! $rc ) { my $err = SCR->Error(".ldapserver"); + y2error("Adding Schema failed: ".$err->{'summary'}." ".$err->{'description'}); $self->SetError( $err->{'summary'}, $err->{'description'} ); return $rc; } $rc = SCR->Write(".ldapserver.schema.addFromLdif", "/etc/openldap/schema/inetorgperson.ldif" ); if ( ! $rc ) { my $err = SCR->Error(".ldapserver"); + y2error("Adding Schema failed: ".$err->{'summary'}." ".$err->{'description'}); $self->SetError( $err->{'summary'}, $err->{'description'} ); return $rc; } $rc = SCR->Write(".ldapserver.schema.addFromSchemafile", "/etc/openldap/schema/rfc2307bis.schema" ); if ( ! $rc ) { my $err = SCR->Error(".ldapserver"); + y2error("Adding Schema failed: ".$err->{'summary'}." ".$err->{'description'}); $self->SetError( $err->{'summary'}, $err->{'description'} ); return $rc; } -- 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] r48653 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc complex.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:50 2008 New Revision: 48653 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48653&view=rev
Log: - reworked initial Schema loading to use ldif and schema Files directly instead of only adding include statements - add rfc2307bis by default Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/agent/SlapdConfigAgent.cc 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:50 2008 @@ -763,12 +763,35 @@ ] }; - @schema = ( "core", "cosine", "inetorgperson" ); - SCR->Execute('.ldapserver.initGlobals' ); - SCR->Execute('.ldapserver.initSchema', \@schema ); + SCR->Execute('.ldapserver.initSchema' ); + my $rc = SCR->Write(".ldapserver.schema.addFromLdif", "/etc/openldap/schema/core.ldif" ); + if ( ! $rc ) { + my $err = SCR->Error(".ldapserver"); + $self->SetError( $err->{'summary'}, $err->{'description'} ); + return $rc; + } + $rc = SCR->Write(".ldapserver.schema.addFromLdif", "/etc/openldap/schema/cosine.ldif" ); + if ( ! $rc ) { + my $err = SCR->Error(".ldapserver"); + $self->SetError( $err->{'summary'}, $err->{'description'} ); + return $rc; + } + $rc = SCR->Write(".ldapserver.schema.addFromLdif", "/etc/openldap/schema/inetorgperson.ldif" ); + if ( ! $rc ) { + my $err = SCR->Error(".ldapserver"); + $self->SetError( $err->{'summary'}, $err->{'description'} ); + return $rc; + } + $rc = SCR->Write(".ldapserver.schema.addFromSchemafile", "/etc/openldap/schema/rfc2307bis.schema" ); + if ( ! $rc ) { + my $err = SCR->Error(".ldapserver"); + $self->SetError( $err->{'summary'}, $err->{'description'} ); + return $rc; + } + SCR->Execute('.ldapserver.initDatabases', [ $frontenddb, $cfgdatabase, $database ] ); - my $rc = SCR->Read('.ldapserver.databases'); + $rc = SCR->Read('.ldapserver.databases'); if ( $dbDefaults{'defaultIndex'} == 1 ) { foreach my $idx ( @defaultIndexes ) 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:50 2008 @@ -180,12 +180,6 @@ else if ( path->component_str(0) == "initSchema" ) { schemaBase = boost::shared_ptr<OlcSchemaConfig>(new OlcSchemaConfig() ); - YCPList schemaList = arg->asList(); - for ( int i = 0; i < schemaList->size(); i++ ) - { - y2milestone("Schemafile to include: %s", schemaList->value(i)->asString()->value_cstr() ); - } - } else if ( path->component_str(0) == "initDatabases" ) { @@ -918,12 +912,14 @@ { LDAPEntry entry, oldEntry; entry = ldif.getEntryRecord(); + y2milestone("adding <%s> to SchemaList", entry.getDN().c_str() ); schema.push_back( boost::shared_ptr<OlcSchemaConfig>(new OlcSchemaConfig(oldEntry, entry)) ); } return YCPBoolean(true); } catch ( std::runtime_error e ) { + std::string errstring = "Error while parsing LDIF file: " + filename; lastError->add(YCPString("summary"), - YCPString("Error while parsing LDIF file") ); + YCPString(errstring) ); lastError->add(YCPString("description"), YCPString(std::string( e.what() ) ) ); return YCPBoolean(false); @@ -1030,15 +1026,15 @@ YCPString SlapdConfigAgent::ConfigToLdif() const { y2milestone("ConfigToLdif"); - OlcDatabaseList::const_iterator i = databases.begin(); std::ostringstream ldif; ldif << globals->toLdif() << std::endl; ldif << schemaBase->toLdif() << std::endl; - LdifWriter writer(ldif); - writer.writeIncludeRecord("/etc/openldap/schema/core.ldif"); - writer.writeIncludeRecord("/etc/openldap/schema/cosine.ldif"); - writer.writeIncludeRecord("/etc/openldap/schema/inetorgperson.ldif"); - ldif << std::endl; + OlcSchemaList::const_iterator j; + for ( j = schema.begin(); j != schema.end() ; j++ ) + { + ldif << (*j)->toLdif() << std::endl; + } + OlcDatabaseList::const_iterator i = databases.begin(); for ( ; i != databases.end(); i++ ) { ldif << (*i)->toLdif() << std::endl; 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:50 2008 @@ -469,8 +469,11 @@ } else if ( ret == `next ) { - LdapServer::ReadFromDefaults(); - ret = `next; + if ( ! LdapServer::ReadFromDefaults() ) + { + DisplayError( LdapServer::GetError() ); + ret = `abort; + } break; } else if ( ret == `back ) -- 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] r48652 - /trunk/ldap-server/src/LdapServer.pm
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:46 2008 New Revision: 48652 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48652&view=rev
Log: create database base-object after writing proposal 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?re…
============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Fri Jun 27 16:00:46 2008 @@ -122,6 +122,8 @@ } ); +my @added_databases = (); + ## # Read all ldap-server settings # @return true on success @@ -196,6 +198,91 @@ return 1; } +sub CreateBaseObjects() +{ + my $self = shift; + foreach my $db (@added_databases ) + { + y2milestone("creating base object for ". $db->{'suffix'} ); + my $object = X500::DN->ParseRFC2253($db->{'suffix'}); + if(! defined $object) { + y2error("Error while parsing base dn"); + return 0; + } + my @attr = $object->getRDN($object->getRDNs()-1)->getAttributeTypes(); + my $val = $object->getRDN($object->getRDNs()-1)->getAttributeValue($attr[0]); + if(!defined $attr[0] || !defined $val) + { + y2error("Error while extracting RDN values"); + return 0; + } + my $entry = {}; + + if( lc($attr[0]) eq "ou") { + $entry = { + "objectClass" => [ "organizationalUnit" ], + "ou" => $val, + } + } elsif( lc($attr[0]) eq "o") { + $entry = { + "objectClass" => [ "organization" ], + "o" => $val, + } + } elsif( lc($attr[0]) eq "c") { + if($val !~ /^\w{2}$/) { + y2error("The countryName must be an ISO-3166 country 2-letter code."); + return 0; + } + $entry = { + "objectClass" => [ "country" ], + "c" => $val, + } + } elsif( lc($attr[0]) eq "l") { + $entry = { + "objectClass" => [ "locality" ], + "l" => $val, + } + } elsif( lc($attr[0]) eq "st") { + $entry = { + "objectClass" => [ "locality" ], + "st" => $val, + } + } elsif( lc($attr[0]) eq "dc") { + $entry = { + "objectClass" => [ "organization", "dcObject" ], + "dc" => $val, + "o" => $val, + } + } else { + y2error("First part of suffix must be c=, st=, l=, o=, ou= or dc=."); + return 0; + } + + if(! SCR->Execute(".ldap", {"hostname" => 'localhost', + "port" => 389})) { + y2error("LDAP init failed"); + return 0; + } + + my $ldapERR; + + if (! SCR->Execute(".ldap.bind", {"bind_dn" => $db->{'rootdn'}, + "bind_pw" => $db->{'rootpw'}}) ) { + $ldapERR = SCR->Read(".ldap.error"); + y2error( "LDAP bind failed" ); + y2error( $ldapERR->{'code'}." : ".$ldapERR->{'msg'}); + return 0; + } + + if (! SCR->Write(".ldap.add", { dn => $db->{'suffix'} } , $entry)) { + my $ldapERR = SCR->Read(".ldap.error"); + y2error("Can not add base entry."); + y2error( $ldapERR->{'code'}." : ".$ldapERR->{'msg'}); + } + y2milestone("base entry added"); + } + return 1; +} ## # Write all ldap-server settings # @return true on success @@ -210,8 +297,9 @@ my $progressItems = [ _("Writing Startup Configuration"), _("Cleaning up config directory"), _("Creating Configuration"), - _("Starting OpenLDAP Server")]; - Progress->New("Writing OpenLDAP Server Configuration", "", 4, $progressItems, $progressItems, ""); + _("Starting OpenLDAP Server"), + _("Creating Base Objects") ]; + Progress->New("Writing OpenLDAP Server Configuration", "", 5, $progressItems, $progressItems, ""); Progress->NextStage(); @@ -296,7 +384,15 @@ Progress->Finish(); return 0; } - + Progress->NextStage(); + $rc = $self->CreateBaseObjects(); + if (! $rc ) + { + y2error("Error while creating base objects"); + $self->SetError( _("Creating base objects failed.") ); + Progress->Finish(); + return 0; + } Progress->Finish(); } else { SCR->Execute('.ldapserver.commitChanges' ); @@ -682,6 +778,9 @@ } y2milestone("Databases: ". Data::Dumper->Dump([$rc])); @databases = @{$rc}; + push @added_databases, { suffix => $dbDefaults{'basedn'}, + rootdn => $dbDefaults{'rootdn'}, + rootpw => $dbDefaults{'rootpw_clear'} }; return 1; } -- 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] r48651 - in /trunk/ldap-server/src: LdapServer.pm tree_structure.ycp
by rhafer@svn.opensuse.org
27 Jun '08
27 Jun '08
Author: rhafer Date: Fri Jun 27 16:00:43 2008 New Revision: 48651 URL:
http://svn.opensuse.org/viewcvs/yast?rev=48651&view=rev
Log: - Don't display "unknown" if a Database has no suffix (like frontend or config) ) - Only display "password policies" and "indexing" for bdb Databases Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/tree_structure.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:43 2008 @@ -696,10 +696,6 @@ my $tmp = { 'type' => $db->{'type'}, 'suffix' => $db->{'suffix'}, 'index' => $db->{'index'} }; - if (! $tmp->{'suffix'} ) - { - $tmp->{'suffix'} = "unknown"; - } push @{$ret}, $tmp; } y2milestone(Data::Dumper->Dump([$ret])); Modified: trunk/ldap-server/src/tree_structure.ycp URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.y…
============================================================================== --- trunk/ldap-server/src/tree_structure.ycp (original) +++ trunk/ldap-server/src/tree_structure.ycp Fri Jun 27 16:00:43 2008 @@ -42,8 +42,6 @@ */ define string current_tree_item = ""; -//define void addDatabaseWidgetMap( string suffix, string item_map, integer index, boolean new_db ); - /********************************* ** callback handlers ** *********************************/ @@ -1195,7 +1193,7 @@ * tree generation functions ** *****************************************/ -void addDatabaseWidgetMap( string label, string item_name, integer index, boolean new_db ) +void addDatabaseWidgetMap( string type, string label, string item_name, integer index, boolean new_db ) { if( haskey( widget_map, item_name ) ) return; map<string, any> dbIndex = $[ @@ -1215,6 +1213,17 @@ ]; map<string,any> item_map = $[ "name" : label, + "index" : index, + "widget" : editBdbDatabase, + "new_db" : new_db, + "dynamic" : true, + "help_page" : "database_detail", + "cb_read" : ``( cb_read_db() ), + "cb_write" : ``( cb_write_db() ), + "cb_input" : ``( cb_input_db() ) + ]; + map<string,any> bdb_item_map = $[ + "name" : label, "children" : [ item_name + "_index", item_name + "_ppolicy" ], "index" : index, "widget" : editBdbDatabase, @@ -1226,9 +1235,17 @@ "cb_input" : ``( cb_input_db() ) ]; y2milestone( "adding database item '%1' as '%2'", label, item_name ); - widget_map[item_name] = item_map; - widget_map[item_name + "_index"] = dbIndex; - widget_map[item_name + "_ppolicy"] = dbPpolicy; + + if ( type == "bdb" ) + { + widget_map[item_name] = bdb_item_map; + widget_map[item_name + "_index"] = dbIndex; + widget_map[item_name + "_ppolicy"] = dbPpolicy; + } + else + { + widget_map[item_name] = item_map; + } widget_map["databases","children"] = add( widget_map["databases","children"]:[], item_name ); } @@ -1244,7 +1261,7 @@ foreach( map<string,string> db, dblist, { string tmp = sformat("%1 (%2)", db["suffix"]:"", db["type"]:"" ); string name = "database-" + tostring(i); - addDatabaseWidgetMap( tmp , name, tointeger(db["index"]:"0"), false ); + addDatabaseWidgetMap( db["type"]:"", tmp , name, tointeger(db["index"]:"0"), false ); i = i+1; } ); y2debug( "databases map is '%1'", (map<string,any>)widget_map["databases"]:$[] ); -- 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
...
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