YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 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
June 2008
- 27 participants
- 711 discussions
[yast-commit] r48610 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc lib/backConfigTest.cpp lib/backConfigTest.h tree_structure.ycp widgets.ycp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:58:00 2008
New Revision: 48610
URL: http://svn.opensuse.org/viewcvs/yast?rev=48610&view=rev
Log:
initial work for support of TLS settings
Modified:
trunk/ldap-server/src/LdapServer.pm
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/lib/backConfigTest.cpp
trunk/ldap-server/src/lib/backConfigTest.h
trunk/ldap-server/src/tree_structure.ycp
trunk/ldap-server/src/widgets.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 15:58:00 2008
@@ -399,6 +399,21 @@
return 1;
}
+BEGIN { $TYPEINFO {GetTlsConfig} = ["function", [ "map", "string", "any" ] ]; }
+sub GetTlsConfig
+{
+ return SCR->Read('.ldapserver.global.tlsSettings' );
+}
+
+BEGIN { $TYPEINFO {SetTlsConfig} = ["function", "boolean", [ "map", "string", "any" ] ]; }
+sub SetTlsConfig
+{
+ my $self = shift;
+ my $tls = shift;
+ my $rc = SCR->Write('.ldapserver.global.tlsSettings', $tls );
+ return 1;
+}
+
BEGIN { $TYPEINFO {MigrateSlapdConf} = ["function", "boolean"]; }
sub MigrateSlapdConf
{
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 15:58:00 2008
@@ -285,6 +285,11 @@
const OlcTlsSettings tls( globals->getTlsSettings() );
ymap.add(YCPString("crlCheck"), YCPInteger( tls.getCrlCheck() ) );
ymap.add(YCPString("verifyClient"), YCPInteger( tls.getVerifyClient() ) );
+ ymap.add(YCPString("caCertDir"), YCPString( tls.getCaCertDir() ) );
+ ymap.add(YCPString("caCertFile"), YCPString( tls.getCaCertFile() ) );
+ ymap.add(YCPString("certFile"), YCPString( tls.getCertFile() ) );
+ ymap.add(YCPString("certKeyFile"), YCPString( tls.getCertKeyFile() ) );
+ ymap.add(YCPString("crlFile"), YCPString( tls.getCrlFile() ) );
return ymap;
}
}
@@ -366,7 +371,8 @@
if ( path->length() == 0 ) {
return YCPNull();
} else {
- if ( path->component_str(0) == "loglevel" ) {
+ if ( path->component_str(0) == "loglevel" )
+ {
y2milestone("Write loglevel");
YCPList levels = arg->asList();
std::list<std::string> levelList;
@@ -377,7 +383,8 @@
globals->setLogLevel( levelList );
return YCPBoolean(true);
}
- if ( path->component_str(0) == "allow" ) {
+ if ( path->component_str(0) == "allow" )
+ {
y2milestone("Write allow Features");
YCPList features = arg->asList();
std::list<std::string> featureList;
@@ -388,8 +395,9 @@
globals->setAllowFeatures( featureList );
return YCPBoolean(true);
}
- if ( path->component_str(0) == "disallow" ) {
- y2milestone("Write allow Features");
+ if ( path->component_str(0) == "disallow" )
+ {
+ y2milestone("Write disallow Features");
YCPList features = arg->asList();
std::list<std::string> featureList;
for ( int i = 0; i < features->size(); i++ )
@@ -399,6 +407,54 @@
globals->setDisallowFeatures( featureList );
return YCPBoolean(true);
}
+ if ( path->component_str(0) == "tlsSettings" )
+ {
+ y2milestone("Write TLS Settings");
+ YCPMap tlsMap = arg->asMap();
+ OlcTlsSettings tls( globals->getTlsSettings() );
+ YCPMapIterator i= tlsMap.begin();
+ for ( ; i != tlsMap.end(); i++ )
+ {
+ std::string key(i.key()->asString()->value_cstr() );
+ y2milestone("tlsMap Key: %s", key.c_str() );
+ if ( key == "caCertDir" )
+ {
+ if ( ! i.value().isNull() )
+ tls.setCaCertDir(i.value()->asString()->value_cstr() );
+ }
+ else if ( key == "caCertFile" )
+ {
+ if ( ! i.value().isNull() )
+ tls.setCaCertFile(i.value()->asString()->value_cstr() );
+ }
+ else if ( key == "certFile" )
+ {
+ if ( ! i.value().isNull() )
+ tls.setCertFile(i.value()->asString()->value_cstr() );
+ }
+ else if ( key == "certKeyFile" )
+ {
+ if ( ! i.value().isNull() )
+ tls.setCertKeyFile(i.value()->asString()->value_cstr() );
+ }
+ else if ( key == "crlCheck" )
+ {
+ }
+ else if ( key == "crlFile" )
+ {
+ if ( ! i.value().isNull() )
+ tls.setCrlFile (i.value()->asString()->value_cstr() );
+ }
+ else if ( key == "verifyClient" )
+ {
+ }
+ else
+ {
+ }
+ }
+ globals->setTlsSettings(tls);
+ return YCPBoolean(true);
+ }
}
return YCPBoolean(false);
}
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 15:58:00 2008
@@ -130,6 +130,12 @@
m_dbEntryChanged.addAttribute(LDAPAttribute("cn", "config"));
}
+OlcGlobalConfig::OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le)
+{
+ std::cout << "OlcGlobalConfig::OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le)" << std::endl;
+
+}
+
const std::vector<std::string> OlcGlobalConfig::getLogLevelString() const
{
StringList lvalues = this->getStringValues("olcLogLevel");
@@ -248,8 +254,15 @@
m_dbEntryChanged.addAttribute(LDAPAttribute("cn", "schema"));
}
-OlcTlsSettings OlcGlobalConfig::getTlsSettings() const {
- return OlcTlsSettings( m_dbEntryChanged );
+OlcTlsSettings OlcGlobalConfig::getTlsSettings() const
+{
+ std::cout << "OlcTlsSettings OlcGlobalConfig::getTlsSettings() const " << std::endl;
+ return OlcTlsSettings( *this );
+}
+
+void OlcGlobalConfig::setTlsSettings( const OlcTlsSettings& tls )
+{
+ tls.applySettings( *this );
}
std::map<std::string, std::list<std::string> > OlcGlobalConfig::toMap() const
@@ -697,7 +710,9 @@
}
OlcTlsSettings::OlcTlsSettings( const OlcGlobalConfig &ogc )
+ : m_crlCheck(0), m_verifyCient(0)
{
+ std::cout << "OlcTlsSettings::OlcTlsSettings( const OlcGlobalConfig &ogc )" << std::endl;
std::string value = ogc.getStringValue("olcTLSCRLCheck");
if ( value == "none" )
{
@@ -731,6 +746,19 @@
m_caCertDir = ogc.getStringValue("olcTlsCaCertificatePath");
m_caCertFile = ogc.getStringValue("olcTlsCaCertificateFile");
+ m_certFile = ogc.getStringValue("olcTlsCertificateFile");
+ m_certKeyFile = ogc.getStringValue("olcTlsCertificateKeyFile");
+ m_crlFile = ogc.getStringValue("olcTlsCrlFile");
+}
+
+void OlcTlsSettings::applySettings( OlcGlobalConfig &ogc ) const
+{
+ std::cout << "OlcTlsSettings::applySettings( OlcGlobalConfig &ogc )" << std::endl;
+ ogc.setStringValue("olcTlsCaCertificatePath", m_caCertDir);
+ ogc.setStringValue("olcTlsCaCertificateFile", m_caCertFile);
+ ogc.setStringValue("olcTlsCertificateFile", m_certFile);
+ ogc.setStringValue("olcTlsCertificateKeyFile", m_certKeyFile);
+ ogc.setStringValue("olcTlsCrlFile", m_crlFile);
}
int OlcTlsSettings::getCrlCheck() const
@@ -761,6 +789,44 @@
return m_caCertFile;
}
+const std::string& OlcTlsSettings::getCertFile() const
+{
+ return m_certFile;
+}
+const std::string& OlcTlsSettings::getCertKeyFile() const
+{
+ return m_certKeyFile;
+}
+const std::string& OlcTlsSettings::getCrlFile() const
+{
+ return m_crlFile;
+}
+
+void OlcTlsSettings::setCaCertDir(const std::string& dir)
+{
+ m_caCertDir = dir;
+}
+
+void OlcTlsSettings::setCaCertFile(const std::string& file)
+{
+ m_caCertFile = file;
+}
+
+void OlcTlsSettings::setCertFile(const std::string& file)
+{
+ m_certFile = file;
+}
+
+void OlcTlsSettings::setCertKeyFile(const std::string& file)
+{
+ m_certKeyFile = file;
+}
+
+void OlcTlsSettings::setCrlFile(const std::string& file)
+{
+ m_crlFile = file;
+}
+
/*
int main(char** argv, int argc)
{
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 15:58:00 2008
@@ -105,7 +105,7 @@
{
public:
OlcGlobalConfig();
- inline OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le) {}
+ explicit OlcGlobalConfig( const LDAPEntry &le);
const std::vector<std::string> getLogLevelString() const;
void setLogLevel(const std::list<std::string> &level);
@@ -117,6 +117,7 @@
void setDisallowFeatures( const std::list<std::string> &features );
OlcTlsSettings getTlsSettings() const;
+ void setTlsSettings( const OlcTlsSettings& tls);
virtual std::map<std::string, std::list<std::string> > toMap() const;
};
@@ -140,19 +141,34 @@
class OlcTlsSettings {
public :
- OlcTlsSettings( const OlcGlobalConfig &le );
+ OlcTlsSettings( const OlcGlobalConfig &ogc );
+
+ void applySettings( OlcGlobalConfig &ogc ) const;
+
int getCrlCheck() const;
- void setCrlCheck();
int getVerifyClient() const;
- void setVerifyClient();
const std::string& getCaCertDir() const;
const std::string& getCaCertFile() const;
+ const std::string& getCertFile() const;
+ const std::string& getCertKeyFile() const;
+ const std::string& getCrlFile() const;
+
+ void setCrlCheck();
+ void setVerifyClient();
+ void setCaCertDir(const std::string& dir);
+ void setCaCertFile(const std::string& file);
+ void setCertFile(const std::string& file);
+ void setCertKeyFile(const std::string& file);
+ void setCrlFile(const std::string& file);
private:
int m_crlCheck;
int m_verifyCient;
std::string m_caCertDir;
std::string m_caCertFile;
+ std::string m_certFile;
+ std::string m_certKeyFile;
+ std::string m_crlFile;
};
#endif /* BACK_CONFIG_TEST_H */
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 15:58:00 2008
@@ -311,6 +311,7 @@
define boolean cb_read_tls()
``{
y2milestone( "calling tls read handler" );
+ LdapServer::GetTlsConfig();
// map<string,string> importPaths = LdapServer::ReadImportCertificates();
// boolean use_common_ca = LdapServer::ReadConfigureCommonServerCertificate();
// map<string,string> tlsSettings = (map<string,string>)LdapServer::ReadTlsSettings();
@@ -361,19 +362,37 @@
define boolean cb_write_tls()
``{
y2milestone( "calling tls write handler" );
- symbol tls_active = (symbol)UI::QueryWidget( `rbg_tls, `CurrentButton );
- if( tls_active == `rb_no )
+ boolean tls_active = (boolean)UI::QueryWidget( `cb_tls_enabled, `Value );
+ if( tls_active == true )
+ {
+ string cafile = (string)UI::QueryWidget( `te_ca_file, `Value );
+
+ map<string,any> tlsSettings = $[
+ "certKeyFile" : (string)UI::QueryWidget( `te_key_file, `Value ),
+ "certFile" : (string)UI::QueryWidget( `te_cert_file, `Value ),
+ "caCertFile" : (string)UI::QueryWidget( `te_ca_file, `Value ),
+ "caCertDir" : "",
+ "crlFile" : "",
+ "crlCheck" : 0,
+ "verifyClient" : 0
+ ];
+ LdapServer::SetTlsConfig( tlsSettings );
+ }
+ else
{
- y2milestone( "calling tls write handler" );
// LdapServer::WriteConfigureCommonServerCertificate( false );
// LdapServer::WriteImportCertificates( $[] );
-// map<string,string> tlsSettings = $[
-// "TLSCertificateKeyFile" : nil,
-// "TLSCertificateFile" : nil,
-// "TLSCACertificateFile" : nil,
-// "TLSCACertificatePath" : nil ];
-//
-// LdapServer::WriteTlsSettings( tlsSettings );
+ map<string,any> tlsSettings = $[
+ "certKeyFIle" : "",
+ "certFile" : "",
+ "caCertFile" : "",
+ "caCertDir" : "",
+ "crlFile" : "",
+ "crlCheck" : 0,
+ "verifyClient" : 0
+ ];
+
+ LdapServer::SetTlsConfig( tlsSettings );
}
return true;
}
@@ -423,10 +442,28 @@
UI::ChangeWidget( `fr_import_cert, `Enabled, true );
}
}
+ else if( handler_cmd == `pb_ca_file )
+ {
+ /* file selection headline */
+ string name = UI::AskForExistingFile( "/etc/ssl/certs", "*.pem *.crt *", _("Select CA Certificate File") );
+ if( name != nil ) UI::ChangeWidget( `te_ca_file, `Value, name );
+ }
+ else if( handler_cmd == `pb_cert_file )
+ {
+ /* file selection headline */
+ string name = UI::AskForExistingFile( "/var/lib/CAM", "*.pem *.crt *", _("Select Certificate File") );
+ if( name != nil ) UI::ChangeWidget( `te_cert_file, `Value, name );
+ }
+ else if( handler_cmd == `pb_key_file )
+ {
+ /* file selection headline */
+ string name = UI::AskForExistingFile( "/var/lib/CAM", "*.pem *.crt *", _("Select Certificate Key File") );
+ if( name != nil ) UI::ChangeWidget( `te_key_file, `Value, name );
+ }
else if( handler_cmd == `pb_edit )
{
// //show edit popup
-// any ret = nil;
+ any ret = nil;
// string dlg_name = common_ca_available ? "type" : "import";
// term dlg = (term)widget_map["g_tls","dialogs",dlg_name]:nil;
// if( dlg == nil )
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 15:58:00 2008
@@ -138,62 +138,64 @@
);
term tlsWidget =
- `VBox(
- `Heading( _("TLS Settings") ),
+ `Top(
`VBox(
- `Frame(
- _("Basic Settings"),
- `VBox(
- `Left(
- `CheckBox( `id( `cb_tls_enabled ), `opt( `notify ) ,
- _("Enable TLS"), false )
- ),
- `Left(
- `CheckBox( `id( `cb_ssl_listener_enabled ),
- _("Enable LDAP over SSL (ldaps) interface"), false )
- ),
- `Left(
- `CheckBox( `id( `cb_use_common_cert ), `opt( `notify ),
- _("Use common Server Certificate"), false )
- ),
- `HStretch()
+ `Heading( _("TLS Settings") ),
+ `VBox(
+ `Frame(
+ _("Basic Settings"),
+ `VBox(
+ `Left(
+ `CheckBox( `id( `cb_tls_enabled ), `opt( `notify ) ,
+ _("Enable TLS"), false )
+ ),
+ `Left(
+ `CheckBox( `id( `cb_ssl_listener_enabled ),
+ _("Enable LDAP over SSL (ldaps) interface"), false )
+ ),
+ `Left(
+ `CheckBox( `id( `cb_use_common_cert ), `opt( `notify ),
+ _("Use common Server Certificate"), false )
+ ),
+ `HStretch()
+ )
)
- )
- ),
- `VSpacing( 0.5 ),
- `VBox(
- `Frame( `id( `fr_import_cert ),
- _("Import Certificate"),
- `VBox(
- `VSquash(
- `HBox(
- `InputField( `id( `te_ca_file ), `opt( `hstretch ),
- _("C&A Certificate File (PEM Format)") ),
- `HSpacing( 0.5 ),
- `Bottom(
- `PushButton( `id( `pb_ca_file ), _("Bro&wse...") )
+ ),
+ `VSpacing( 0.5 ),
+ `VBox(
+ `Frame( `id( `fr_import_cert ),
+ _("Import Certificate"),
+ `VBox(
+ `VSquash(
+ `HBox(
+ `InputField( `id( `te_ca_file ), `opt( `hstretch ),
+ _("C&A Certificate File (PEM Format)") ),
+ `HSpacing( 0.5 ),
+ `Bottom(
+ `PushButton( `id( `pb_ca_file ), _("Bro&wse...") )
+ )
)
- )
- ),
- `VSpacing( 0.5 ),
- `VSquash(
- `HBox(
- `InputField( `id( `te_cert_file ), `opt( `hstretch ),
- _("Certificate &File (PEM Format)") ),
- `HSpacing( 0.5 ),
- `Bottom(
- `PushButton( `id( `pb_cert_file ), _("&Browse...") )
+ ),
+ `VSpacing( 0.5 ),
+ `VSquash(
+ `HBox(
+ `InputField( `id( `te_cert_file ), `opt( `hstretch ),
+ _("Certificate &File (PEM Format)") ),
+ `HSpacing( 0.5 ),
+ `Bottom(
+ `PushButton( `id( `pb_cert_file ), _("&Browse...") )
+ )
)
- )
- ),
- `VSpacing( 0.5 ),
- `VSquash(
- `HBox(
- `InputField( `id( `te_key_file ), `opt( `hstretch ),
- _("Certificate &Key File (PEM Format -- Unencrypted)") ),
- `HSpacing( 0.5 ),
- `Bottom(
- `PushButton( `id( `pb_key_file ), _("B&rowse...") )
+ ),
+ `VSpacing( 0.5 ),
+ `VSquash(
+ `HBox(
+ `InputField( `id( `te_key_file ), `opt( `hstretch ),
+ _("Certificate &Key File (PEM Format - Unencrypted)") ),
+ `HSpacing( 0.5 ),
+ `Bottom(
+ `PushButton( `id( `pb_key_file ), _("B&rowse...") )
+ )
)
)
)
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48609 - in /trunk/ldap-server/src: LdapServer.pm tree_structure.ycp widgets.ycp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:55 2008
New Revision: 48609
URL: http://svn.opensuse.org/viewcvs/yast?rev=48609&view=rev
Log:
Reworked TLS Dialog
Modified:
trunk/ldap-server/src/LdapServer.pm
trunk/ldap-server/src/tree_structure.ycp
trunk/ldap-server/src/widgets.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 15:57:55 2008
@@ -551,5 +551,30 @@
}
+BEGIN { $TYPEINFO {HaveCommonServerCertificate} = ["function", "boolean" ]; }
+sub HaveCommonServerCertificate
+{
+ my $self = shift;
+ y2milestone("HaveCommonServerCertificate");
+
+ if (SCR->Read(".target.size", '/etc/ssl/certs/YaST-CA.pem') <= 0)
+ {
+ y2milestone("YaST-CA.pem does not exists");
+ return YaST::YCP::Boolean(0);
+ }
+
+ if (SCR->Read(".target.size", '/etc/ssl/servercerts/servercert.pem') <= 0 )
+ {
+ y2milestone("Common server certificate file does not exist");
+ return YaST::YCP::Boolean(0);
+ }
+ if ( SCR->Read(".target.size", '/etc/ssl/servercerts/serverkey.pem') <= 0 )
+ {
+ y2milestone("Common server certificate key file does not exist");
+ return YaST::YCP::Boolean(0);
+ }
+ return YaST::YCP::Boolean(1);
+}
+
1;
# EOF
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 15:57:55 2008
@@ -382,18 +382,49 @@
``{
y2milestone( "calling tls input handler" );
-// boolean common_ca_available = LdapServer::ReadCommonServerCertificateAvailable();
-//
-// if( handler_cmd == `rb_yes )
-// {
-// UI::ChangeWidget( `rt_tls_info, `Enabled, true );
-// UI::ChangeWidget( `pb_edit, `Enabled, true );
-// } else if( handler_cmd == `rb_no )
-// {
-// UI::ChangeWidget( `rt_tls_info, `Enabled, false );
-// UI::ChangeWidget( `pb_edit, `Enabled, false );
-// } else if( handler_cmd == `pb_edit )
-// {
+ boolean common_cert_available = LdapServer::HaveCommonServerCertificate();
+
+ if( handler_cmd == `cb_tls_enabled )
+ {
+ boolean tls_enabled_cb = (boolean)UI::QueryWidget( `cb_tls_enabled, `Value );
+ if ( tls_enabled_cb )
+ {
+ UI::ChangeWidget( `cb_ssl_listener_enabled, `Enabled, true );
+ if ( common_cert_available )
+ {
+ UI::ChangeWidget( `cb_use_common_cert, `Enabled, true );
+ } else {
+ UI::ChangeWidget( `fr_import_cert, `Enabled, true );
+ }
+
+ } else {
+ UI::ChangeWidget( `cb_ssl_listener_enabled, `Enabled, false );
+ UI::ChangeWidget( `cb_use_common_cert, `Enabled, false );
+ UI::ChangeWidget( `fr_import_cert, `Enabled, false );
+ }
+ }
+ else if( handler_cmd == `cb_use_common_cert )
+ {
+ boolean use_common_cert = (boolean)UI::QueryWidget( `cb_use_common_cert, `Value );
+ if ( use_common_cert )
+ {
+ if ( common_cert_available )
+ {
+ UI::ChangeWidget( `te_ca_file, `Value, "/etc/ssl/certs/YaST-CA.pem");
+ UI::ChangeWidget( `te_cert_file, `Value, "/etc/ssl/servercerts/servercert.pem");
+ UI::ChangeWidget( `te_key_file, `Value, "/etc/ssl/servercerts/servercert.pem");
+ UI::ChangeWidget( `fr_import_cert, `Enabled, false );
+ } else {
+ Popup::Error( _("A common server certificate is not available") );
+ UI::ChangeWidget( `cb_use_common_cert, `Value, false );
+ UI::ChangeWidget( `cb_use_common_cert, `Enabled, false );
+ }
+ } else {
+ UI::ChangeWidget( `fr_import_cert, `Enabled, true );
+ }
+ }
+ else if( handler_cmd == `pb_edit )
+ {
// //show edit popup
// any ret = nil;
// string dlg_name = common_ca_available ? "type" : "import";
@@ -513,7 +544,7 @@
//
// UI::CloseDialog();
// eval( cb_read_tls() );
-// }
+ }
//reread tls page
return true;
}
@@ -1030,10 +1061,6 @@
/* Tree item */
"name" : _("TLS Settings"),
"widget" : tlsWidget,
- "dialogs" : $[
- "type" : tlsTypeWidget,
- "import": tlsImportWidget,
- ],
"cb_check" : ``( cb_check_tls() ),
"cb_read" : ``( cb_read_tls() ),
"cb_write" : ``( cb_write_tls() ),
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 15:57:55 2008
@@ -140,79 +140,65 @@
term tlsWidget =
`VBox(
`Heading( _("TLS Settings") ),
- `Frame(
- _("TLS Active"),
- `RadioButtonGroup(
- `id( `rbg_tls ),
- `HBox(
- `RadioButton( `id( `rb_yes ), `opt( `notify ), Label::YesButton() ),
- `RadioButton( `id( `rb_no ), `opt( `notify ), Label::NoButton() )
- )
- )
- ),
- `RichText( `id( `rt_tls_info ), "" ),
- `PushButton( `id( `pb_edit ), _("&Select Certificate...") )
- );
-
- term tlsTypeWidget =
- `VBox(
- `Heading( _("Select Type") ),
- `VSpacing( 1 ),
- `RadioButtonGroup(
- `id( `rbg_type ),
- `VBox (
- `Left(
- `RadioButton( `id( `rb_import ), _("&Import Certificates") )
- ),
- `Left(
- `RadioButton( `id( `rb_common ), _("Use C&ommon Server Certificate"), true )
- )
- )
- ),
- `VSpacing( 1 ),
- `HBox(
- `PushButton( `id( `ok ), Label::OKButton() ),
- `PushButton( `id( `cancel ), Label::CancelButton())
- )
- );
-
- term tlsImportWidget =
- `VBox(
- `Heading( _("Import Certificate") ),
- `VSpacing( 1 ),
- `VSquash(
- `HBox(
- `TextEntry( `id( `te_cert_file ), _("Certificate &File (PEM Format)") ),
- `HSpacing( 0.5 ),
- `Bottom(
- `PushButton( `id( `pb_cert_file ), _("&Browse...") )
- )
- )
- ),
- `VSpacing( 0.5 ),
- `VSquash(
- `HBox(
- `TextEntry( `id( `te_key_file ), _("Certificate &Key File (PEM Format -- Unencrypted)")+" " ),
- `HSpacing( 0.5 ),
- `Bottom(
- `PushButton( `id( `pb_key_file ), _("B&rowse...") )
+ `VBox(
+ `Frame(
+ _("Basic Settings"),
+ `VBox(
+ `Left(
+ `CheckBox( `id( `cb_tls_enabled ), `opt( `notify ) ,
+ _("Enable TLS"), false )
+ ),
+ `Left(
+ `CheckBox( `id( `cb_ssl_listener_enabled ),
+ _("Enable LDAP over SSL (ldaps) interface"), false )
+ ),
+ `Left(
+ `CheckBox( `id( `cb_use_common_cert ), `opt( `notify ),
+ _("Use common Server Certificate"), false )
+ ),
+ `HStretch()
)
)
),
`VSpacing( 0.5 ),
- `VSquash(
- `HBox(
- `TextEntry( `id( `te_ca_file ), _("C&A Certificate File (PEM Format)") ),
- `HSpacing( 0.5 ),
- `Bottom(
- `PushButton( `id( `pb_ca_file ), _("Bro&wse...") )
+ `VBox(
+ `Frame( `id( `fr_import_cert ),
+ _("Import Certificate"),
+ `VBox(
+ `VSquash(
+ `HBox(
+ `InputField( `id( `te_ca_file ), `opt( `hstretch ),
+ _("C&A Certificate File (PEM Format)") ),
+ `HSpacing( 0.5 ),
+ `Bottom(
+ `PushButton( `id( `pb_ca_file ), _("Bro&wse...") )
+ )
+ )
+ ),
+ `VSpacing( 0.5 ),
+ `VSquash(
+ `HBox(
+ `InputField( `id( `te_cert_file ), `opt( `hstretch ),
+ _("Certificate &File (PEM Format)") ),
+ `HSpacing( 0.5 ),
+ `Bottom(
+ `PushButton( `id( `pb_cert_file ), _("&Browse...") )
+ )
+ )
+ ),
+ `VSpacing( 0.5 ),
+ `VSquash(
+ `HBox(
+ `InputField( `id( `te_key_file ), `opt( `hstretch ),
+ _("Certificate &Key File (PEM Format -- Unencrypted)") ),
+ `HSpacing( 0.5 ),
+ `Bottom(
+ `PushButton( `id( `pb_key_file ), _("B&rowse...") )
+ )
+ )
+ )
)
)
- ),
- `VSpacing( 1 ),
- `HBox(
- `PushButton( `id( `ok ), Label::OKButton() ),
- `PushButton( `id( `cancel ), Label::CancelButton() )
)
);
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:51 2008
New Revision: 48608
URL: http://svn.opensuse.org/viewcvs/yast?rev=48608&view=rev
Log:
Added blank lines for better readability
Modified:
trunk/ldap-server/src/widgets.ycp
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 15:57:51 2008
@@ -153,6 +153,7 @@
`RichText( `id( `rt_tls_info ), "" ),
`PushButton( `id( `pb_edit ), _("&Select Certificate...") )
);
+
term tlsTypeWidget =
`VBox(
`Heading( _("Select Type") ),
@@ -174,6 +175,7 @@
`PushButton( `id( `cancel ), Label::CancelButton())
)
);
+
term tlsImportWidget =
`VBox(
`Heading( _("Import Certificate") ),
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48607 - /trunk/ldap-server/src/lib/backConfigTest.cpp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:48 2008
New Revision: 48607
URL: http://svn.opensuse.org/viewcvs/yast?rev=48607&view=rev
Log:
Fixed format
Modified:
trunk/ldap-server/src/lib/backConfigTest.cpp
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 15:57:48 2008
@@ -140,11 +140,11 @@
std::istringstream iss(*i);
int intlogValue;
if ( iss >> intlogValue ) {
- std::cerr << "IntegerValue" << *i << std::endl;
+ std::cerr << "IntegerValue " << *i << std::endl;
}
else
{
- std::cerr << "StringValue" << *i << std::endl;
+ std::cerr << "StringValue " << *i << std::endl;
lvls.push_back(*i);
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48606 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc lib/backConfigTest.cpp lib/backConfigTest.h tree_structure.ycp widgets.ycp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:44 2008
New Revision: 48606
URL: http://svn.opensuse.org/viewcvs/yast?rev=48606&view=rev
Log:
bring back write support for loglevel and allow/disallow
Modified:
trunk/ldap-server/src/LdapServer.pm
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/lib/backConfigTest.cpp
trunk/ldap-server/src/lib/backConfigTest.h
trunk/ldap-server/src/tree_structure.ycp
trunk/ldap-server/src/widgets.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 15:57:44 2008
@@ -31,7 +31,6 @@
my $slapdConfChanged = 0;
my $serviceEnabled = 0;
my $registerSlp = 0;
-my @loglevel = ();
my %dbDefaults = ();
my @databases = ();
@@ -88,9 +87,6 @@
y2milestone("Databases: ". Data::Dumper->Dump([$rc]));
#$rc = SCR->Read('.ldapserver.global.tlsSettings' );
#y2milestone("tlsSettings: ". Data::Dumper->Dump([$rc]));
- $rc = SCR->Read('.ldapserver.global.loglevel' );
- y2milestone("loglevel: ". Data::Dumper->Dump([$rc]));
- @loglevel = @{$rc};
}
}
else
@@ -361,7 +357,7 @@
BEGIN { $TYPEINFO {GetLogLevels} = ["function", [ "list", "string" ] ]; }
sub GetLogLevels
{
- return \@loglevel;
+ return SCR->Read('.ldapserver.global.loglevel' );
}
BEGIN { $TYPEINFO {SetLogLevels} = ["function", "boolean", [ "list", "string" ] ]; }
@@ -369,12 +365,40 @@
{
my $self = shift;
my $lvls = shift;
- @loglevel = @{$lvls};
-
SCR->Write('.ldapserver.global.loglevel', $lvls );
return 1;
}
+BEGIN { $TYPEINFO {GetAllowFeatures} = ["function", [ "list", "string" ] ]; }
+sub GetAllowFeatures
+{
+ return SCR->Read('.ldapserver.global.allow' );
+}
+
+BEGIN { $TYPEINFO {GetDisallowFeatures} = ["function", [ "list", "string" ] ]; }
+sub GetDisallowFeatures
+{
+ return SCR->Read('.ldapserver.global.disallow' );
+}
+
+BEGIN { $TYPEINFO {SetAllowFeatures} = ["function", "boolean", [ "list", "string" ] ]; }
+sub SetAllowFeatures
+{
+ my $self = shift;
+ my $features = shift;
+ SCR->Write('.ldapserver.global.allow', $features );
+ return 1;
+}
+
+BEGIN { $TYPEINFO {SetDisallowFeatures} = ["function", "boolean", [ "list", "string" ] ]; }
+sub SetDisallowFeatures
+{
+ my $self = shift;
+ my $features = shift;
+ SCR->Write('.ldapserver.global.disallow', $features );
+ return 1;
+}
+
BEGIN { $TYPEINFO {MigrateSlapdConf} = ["function", "boolean"]; }
sub MigrateSlapdConf
{
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 15:57:44 2008
@@ -195,6 +195,9 @@
}
else if ( path->component_str(0) == "commitChanges" )
{
+ if ( globals )
+ olc.updateEntry( *globals );
+
OlcDatabaseList::const_iterator i;
for ( i = databases.begin(); i != databases.end() ; i++ )
{
@@ -236,6 +239,10 @@
}
else
{
+ if ( globals == 0 )
+ {
+ globals = olc.getGlobals();
+ }
if ( path->component_str(0) == "loglevel" )
{
y2milestone("Read loglevel");
@@ -248,6 +255,30 @@
}
return yLevelList;
}
+ if ( path->component_str(0) == "allow" )
+ {
+ y2milestone("Read allow Features");
+ YCPList yFeatureList;
+ const std::vector<std::string> loglevel = globals->getAllowFeatures();
+ std::vector<std::string>::const_iterator i;
+ for ( i = loglevel.begin(); i != loglevel.end(); i++ )
+ {
+ yFeatureList.add(YCPString(*i) );
+ }
+ return yFeatureList;
+ }
+ if ( path->component_str(0) == "disallow" )
+ {
+ y2milestone("Read allow Features");
+ YCPList yFeatureList;
+ const std::vector<std::string> loglevel = globals->getDisallowFeatures();
+ std::vector<std::string>::const_iterator i;
+ for ( i = loglevel.begin(); i != loglevel.end(); i++ )
+ {
+ yFeatureList.add(YCPString(*i) );
+ }
+ return yFeatureList;
+ }
if ( path->component_str(0) == "tlsSettings" )
{
YCPMap ymap;
@@ -344,7 +375,28 @@
levelList.push_back( levels->value(i)->asString()->value_cstr() );
}
globals->setLogLevel( levelList );
- //olc.setGlobals(olcg);
+ return YCPBoolean(true);
+ }
+ if ( path->component_str(0) == "allow" ) {
+ y2milestone("Write allow Features");
+ YCPList features = arg->asList();
+ std::list<std::string> featureList;
+ for ( int i = 0; i < features->size(); i++ )
+ {
+ featureList.push_back( features->value(i)->asString()->value_cstr() );
+ }
+ globals->setAllowFeatures( featureList );
+ return YCPBoolean(true);
+ }
+ if ( path->component_str(0) == "disallow" ) {
+ y2milestone("Write allow Features");
+ YCPList features = arg->asList();
+ std::list<std::string> featureList;
+ for ( int i = 0; i < features->size(); i++ )
+ {
+ featureList.push_back( features->value(i)->asString()->value_cstr() );
+ }
+ globals->setDisallowFeatures( featureList );
return YCPBoolean(true);
}
}
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 15:57:44 2008
@@ -130,20 +130,6 @@
m_dbEntryChanged.addAttribute(LDAPAttribute("cn", "config"));
}
-int OlcGlobalConfig::getLogLevel() const
-{
- const LDAPAttribute *attr = m_dbEntryChanged.getAttributeByName("olcloglevel");
- if (attr) {
- StringList sl = attr->getValues();
- StringList::const_iterator i;
- for (i = sl.begin(); i != sl.end(); i++ ) {
- std::cout << "loglevel: " << *i << std::endl;
- }
- } else {
- return 0;
- }
-}
-
const std::vector<std::string> OlcGlobalConfig::getLogLevelString() const
{
StringList lvalues = this->getStringValues("olcLogLevel");
@@ -170,29 +156,54 @@
//
//}
-void OlcGlobalConfig::setLogLevel(int level) {
+void OlcGlobalConfig::setLogLevel(const std::list<std::string> &level) {
const LDAPAttribute *sattr = m_dbEntryChanged.getAttributeByName("olcloglevel");
- LDAPAttribute attr;
+ LDAPAttribute attr( "olcloglevel" );
if ( sattr ) {
attr = *sattr;
}
- std::ostringstream o;
StringList values;
- o << level;
- values.add(o.str());
+ std::list<std::string>::const_iterator i = level.begin();
+ for(; i != level.end(); i++ )
+ {
+ values.add(*i);
+ }
attr.setValues(values);
m_dbEntryChanged.replaceAttribute(attr);
}
-void OlcGlobalConfig::setLogLevel(const std::list<std::string> &level) {
+void OlcGlobalConfig::addLogLevel(std::string level) {
const LDAPAttribute *sattr = m_dbEntryChanged.getAttributeByName("olcloglevel");
- LDAPAttribute attr( "olcloglevel" );
+ LDAPAttribute attr;
+ if ( sattr ) {
+ attr = *sattr;
+ }
+ attr.addValue(level);
+ m_dbEntryChanged.replaceAttribute(attr);
+}
+
+const std::vector<std::string> OlcGlobalConfig::getAllowFeatures() const
+{
+ StringList values = this->getStringValues("olcAllows");
+ StringList::const_iterator i;
+ std::vector<std::string> allow;
+ for ( i = values.begin(); i != values.end(); i++ )
+ {
+ allow.push_back(*i);
+ }
+ return allow;
+}
+
+void OlcGlobalConfig::setAllowFeatures(const std::list<std::string> &allow )
+{
+ const LDAPAttribute *sattr = m_dbEntryChanged.getAttributeByName("olcAllows");
+ LDAPAttribute attr( "olcAllows" );
if ( sattr ) {
attr = *sattr;
}
StringList values;
- std::list<std::string>::const_iterator i = level.begin();
- for(; i != level.end(); i++ )
+ std::list<std::string>::const_iterator i = allow.begin();
+ for(; i != allow.end(); i++ )
{
values.add(*i);
}
@@ -200,16 +211,36 @@
m_dbEntryChanged.replaceAttribute(attr);
}
-void OlcGlobalConfig::addLogLevel(std::string level) {
- const LDAPAttribute *sattr = m_dbEntryChanged.getAttributeByName("olcloglevel");
- LDAPAttribute attr;
+const std::vector<std::string> OlcGlobalConfig::getDisallowFeatures() const
+{
+ StringList values = this->getStringValues("olcDisallows");
+ StringList::const_iterator i;
+ std::vector<std::string> allow;
+ for ( i = values.begin(); i != values.end(); i++ )
+ {
+ allow.push_back(*i);
+ }
+ return allow;
+}
+
+void OlcGlobalConfig::setDisallowFeatures(const std::list<std::string> &disallow )
+{
+ const LDAPAttribute *sattr = m_dbEntryChanged.getAttributeByName("olcDisallows");
+ LDAPAttribute attr( "olcDisallows" );
if ( sattr ) {
attr = *sattr;
}
- attr.addValue(level);
+ StringList values;
+ std::list<std::string>::const_iterator i = disallow.begin();
+ for(; i != disallow.end(); i++ )
+ {
+ values.add(*i);
+ }
+ attr.setValues(values);
m_dbEntryChanged.replaceAttribute(attr);
}
+
OlcSchemaConfig::OlcSchemaConfig() : OlcConfigEntry()
{
m_dbEntryChanged.setDN("cn=schema,cn=config");
@@ -547,7 +578,7 @@
}
bool replace = false;
if ( delValues.size() > 0 ) {
- if ( (int) delValues.size() == i->getNumValues() ) {
+ if ( (addValues.size() > 0) && ( (int)delValues.size() == i->getNumValues()) ) {
std::cout << "All Values deleted, this is a replace" << std::endl;
modifications.addModification(
LDAPModification( LDAPAttribute(i->getName(), addValues),
@@ -575,6 +606,22 @@
);
}
}
+ i = m_dbEntryChanged.getAttributes()->begin();
+ for(; i != m_dbEntryChanged.getAttributes()->end(); i++ )
+ {
+ std::cout << i->getName() << std::endl;
+ const LDAPAttribute *old = m_dbEntry.getAttributeByName(i->getName());
+ if (! old ) {
+ std::cout << "Attribute added: " << i->getName() << std::endl;
+ if (! i->getValues().empty() )
+ {
+ modifications.addModification(
+ LDAPModification( LDAPAttribute(i->getName(), i->getValues()),
+ LDAPModification::OP_ADD)
+ );
+ }
+ }
+ }
return modifications;
}
@@ -583,7 +630,7 @@
}
-OlcGlobalConfig OlcConfig::getGlobals()
+boost::shared_ptr<OlcGlobalConfig> OlcConfig::getGlobals()
{
LDAPSearchResults *sr;
LDAPEntry *dbEntry;
@@ -596,10 +643,11 @@
}
if ( dbEntry ) {
std::cout << "Got GlobalConfig: " << dbEntry->getDN() << std::endl;
- OlcGlobalConfig gc(*dbEntry);
+ boost::shared_ptr<OlcGlobalConfig> gc( new OlcGlobalConfig(*dbEntry) );
return gc;
}
- return OlcGlobalConfig();
+ boost::shared_ptr<OlcGlobalConfig> gc( new OlcGlobalConfig() );
+ return gc;
}
void OlcConfig::setGlobals( OlcGlobalConfig &olcg)
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 15:57:44 2008
@@ -106,11 +106,16 @@
public:
OlcGlobalConfig();
inline OlcGlobalConfig( const LDAPEntry &le) : OlcConfigEntry(le) {}
- int getLogLevel() const;
+
const std::vector<std::string> getLogLevelString() const;
- void setLogLevel(int level);
void setLogLevel(const std::list<std::string> &level);
void addLogLevel(std::string level);
+
+ const std::vector<std::string> getAllowFeatures() const;
+ void setAllowFeatures( const std::list<std::string> &features );
+ const std::vector<std::string> getDisallowFeatures() const;
+ void setDisallowFeatures( const std::list<std::string> &features );
+
OlcTlsSettings getTlsSettings() const;
virtual std::map<std::string, std::list<std::string> > toMap() const;
};
@@ -125,7 +130,7 @@
class OlcConfig {
public:
OlcConfig(LDAPConnection *lc=0 );
- OlcGlobalConfig getGlobals();
+ boost::shared_ptr<OlcGlobalConfig> getGlobals();
void setGlobals( OlcGlobalConfig &olcg);
void updateEntry( const OlcConfigEntry &oce );
OlcDatabaseList getDatabases();
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 15:57:44 2008
@@ -261,8 +261,10 @@
define boolean cb_read_allow()
``{
y2milestone( "calling allow read handler" );
-// list<string> allowlist = LdapServer::ReadAllowList();
-// UI::ChangeWidget( `msb_allow, `SelectedItems, allowlist );
+ list<string> allowlist = LdapServer::GetAllowFeatures();
+ list<string> disallowlist = LdapServer::GetDisallowFeatures();
+ UI::ChangeWidget( `msb_allow, `SelectedItems, allowlist );
+ UI::ChangeWidget( `msb_disallow, `SelectedItems, disallowlist );
return true;
}
@@ -270,10 +272,13 @@
``{
y2milestone( "calling allow write handler" );
list<string> allowlist = [];
+ list<string> disallowlist = [];
allowlist = (list<string>)UI::QueryWidget( `msb_allow, `SelectedItems );
+ disallowlist = (list<string>)UI::QueryWidget( `msb_disallow, `SelectedItems );
y2milestone( "writing allowlist: '%1'", allowlist );
-// LdapServer::WriteAllowList( allowlist );
+ LdapServer::SetAllowFeatures( allowlist );
+ LdapServer::SetDisallowFeatures( disallowlist );
return true;
}
@@ -1015,7 +1020,7 @@
],
"g_allow" : $[
/* Tree item */
- "name" : _("Allow Settings"),
+ "name" : _("Allow/Disallow Features"),
"widget" : allowWidget,
"cb_check" : ``( cb_check_allow() ),
"cb_read" : ``( cb_read_allow() ),
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 15:57:44 2008
@@ -118,13 +118,23 @@
);
term allowWidget =
- `MultiSelectionBox(
- `id( `msb_allow ), _("Select &Allow Flags:"), [
- `item( `id( "bind_v2" ), _("LDAPv2 Bind Requests") ),
- `item( `id( "bind_anon_cred" ), _("Anonymous Bind when Credentials Not Empty") ),
- `item( `id( "bind_anon_dn" ), _("Unauthenticated Bind when DN Not Empty") ),
- `item( `id( "update_anon" ), _("Unauthenticated Update Options to Process") )
- ]
+ `VBox (
+ `MultiSelectionBox(
+ `id( `msb_allow ), _("Select &Allow Flags:"), [
+ `item( `id( "bind_v2" ), _("LDAPv2 Bind Requests") ),
+ `item( `id( "bind_anon_cred" ), _("Anonymous Bind when Credentials Not Empty") ),
+ `item( `id( "bind_anon_dn" ), _("Unauthenticated Bind when DN Not Empty") ),
+ `item( `id( "update_anon" ), _("Unauthenticated Update Options to Process") )
+ ]
+ ),
+ `MultiSelectionBox(
+ `id( `msb_disallow ), _("Select &Disallow Flags:"), [
+ `item( `id( "bind_anon" ), _("Disable acceptance of anonymous Bind Requests (does not prohibit anonymous directory access)") ),
+ `item( `id( "bind_simple" ), _("Disable Simple Bind authentication") ),
+ `item( `id( "tls_2_anon" ), _("Disable forcing session to anonymous status upon StartTLS operation receipt") ),
+ `item( `id( "tls_authc" ), _("Disallow the StartTLS operation if authenticated") )
+ ]
+ )
);
term tlsWidget =
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48605 - in /trunk/ldap-server/src: tree_structure.ycp widgets.ycp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:38 2008
New Revision: 48605
URL: http://svn.opensuse.org/viewcvs/yast?rev=48605&view=rev
Log:
Separated database widgets
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 15:57:38 2008
@@ -1063,7 +1063,7 @@
map<string,any> item_map = $[
"name" : suffix,
"index" : index,
- "widget" : editDbWidget,
+ "widget" : editBdbDatabase,
"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 15:57:38 2008
@@ -292,36 +292,55 @@
`HSpacing(0.25)
);
- term editDbWidget =
- `VBox(
- `Heading( _("Edit Database") ),
- `VSpacing( 1 ),
- `Frame ( _("General Settings"),
- `VBox(
- `TextEntry( `id( `te_basedn ), `opt( `disabled ), _("&Base DN") ),
- `VSpacing( 0.5 ),
- `VSquash(
- `HBox(
- `TextEntry( `id( `te_rootdn ), _("&Root DN") ),
- `HSpacing( 0.5 ),
- `VBox(
- `Bottom(
- `CheckBox( `id( `cb_append_basedn ), _("&Append Base DN") )
- ),
- `VSpacing( 0.3 )
- )
- )
- ),
- `VSpacing( 0.5 ),
+ term generalDbWidget =
+ `Frame ( _("General Settings"),
+ `VBox(
+ `TextEntry( `id( `te_basedn ), `opt( `disabled ), _("&Base DN") ),
+ `VSpacing( 0.5 ),
+ `VSquash(
`HBox(
- `Password( `id( `te_rootpw ), _("LDAP &Password") ),
+ `TextEntry( `id( `te_rootdn ), _("&Root DN") ),
`HSpacing( 0.5 ),
- `Password( `id( `te_valid_rootpw ), _("&Validate Password") ),
- `HSpacing( 0.5 ),
- `ComboBox( `id( `cb_cryptmethod ), _("&Encryption"), enc_types )
+ `VBox(
+ `Bottom(
+ `CheckBox( `id( `cb_append_basedn ), _("&Append Base DN") )
+ ),
+ `VSpacing( 0.3 )
+ )
)
+ ),
+ `VSpacing( 0.5 ),
+ `HBox(
+// `Password( `id( `te_rootpw ), _("LDAP &Password") ),
+// `HSpacing( 0.5 ),
+// `Password( `id( `te_valid_rootpw ), _("&Validate Password") ),
+// `HSpacing( 0.5 ),
+// `Left(
+// `ComboBox( `id( `cb_cryptmethod ), _("Password &Encryption"), enc_types )
+// ),
+ `Left(
+ `PushButton( `id( `pb_changepw ), _("Change Password") )
+ )
+ ),
+ `VSpacing( 0.5 ),
+ `Left(
+ `CheckBox( `id( `cb_dbreadonly ), _("Database is read-only"), false )
+ ),
+ `Left(
+ `CheckBox( `id( `cb_dbmonitoring ), _("Enable Monitoring"), false )
)
- ),
+ )
+ );
+
+ term editBdbDatabase =
+ `VBox(
+ `Heading( _("Edit BDB Database") ),
+ `VSpacing( 1 ),
+ generalDbWidget
+ );
+
+ term editPolicy =
+ `VBox(
`VSpacing( 1 ),
`Frame( _("Password Policy Settings"),
`VBox( `VSpacing(0.25),
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48604 - /trunk/ldap-server/src/lib/backConfigTest.cpp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:34 2008
New Revision: 48604
URL: http://svn.opensuse.org/viewcvs/yast?rev=48604&view=rev
Log:
Only issue Modify Request if ModList is not empty
Modified:
trunk/ldap-server/src/lib/backConfigTest.cpp
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 15:57:34 2008
@@ -617,7 +617,11 @@
{
try {
LDAPModList ml = oce.entryDifftoMod();
- m_lc->modify( oce.getDn(), &ml );
+ if ( ! ml.empty() ) {
+ m_lc->modify( oce.getDn(), &ml );
+ } else {
+ std::cout << oce.getDn() << ": no changes" << std::endl;
+ }
} catch (LDAPException e) {
std::cout << e << std::endl;
throw;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48603 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc agent/SlapdConfigAgent.h lib/backConfigTest.cpp lib/backConfigTest.h tree_structure.ycp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:30 2008
New Revision: 48603
URL: http://svn.opensuse.org/viewcvs/yast?rev=48603&view=rev
Log:
- reading Database is now done with .ldapserver.database.{index}
- initial write support for databases
Modified:
trunk/ldap-server/src/LdapServer.pm
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/agent/SlapdConfigAgent.h
trunk/ldap-server/src/lib/backConfigTest.cpp
trunk/ldap-server/src/lib/backConfigTest.h
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 15:57:30 2008
@@ -123,95 +123,100 @@
my $self = shift;
y2milestone("LdapServer::Write");
my $ret = 1;
- my $progressItems = [ _("Writing Startup Configuration"),
- _("Cleaning up config directory"),
- _("Creating Configuration"),
- _("Starting OpenLDAP Server")];
- Progress->New("Writing OpenLDAP Server Configuration", "", 4, $progressItems, $progressItems, "");
-
- Progress->NextStage();
-
- my $rc = SCR->Write('.sysconfig.openldap.OPENLDAP_CONFIG_BACKEND', 'ldap');
- if ( ! $rc )
- {
- y2error("Error while switch to config backend");
- $self->SetError( _("Switch from slapd.conf to config backend failed.") );
- Progress->Finish();
- return 0;
- }
- $rc = SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'yes');
- if ( ! $rc )
+ if ( ! $usesBackConfig )
{
- y2error("Error while enabling LDAPI listener");
- $self->SetError( _("Enabling thi LDAPI Protocol listener failed.") );
- Progress->Finish();
- return 0;
- }
- $rc = SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAPI');
- y2milestone(Data::Dumper->Dump([$rc]));
+ my $progressItems = [ _("Writing Startup Configuration"),
+ _("Cleaning up config directory"),
+ _("Creating Configuration"),
+ _("Starting OpenLDAP Server")];
+ Progress->New("Writing OpenLDAP Server Configuration", "", 4, $progressItems, $progressItems, "");
- # FIXME:
- # Explicit cache flush, see bnc#350581 for details
- SCR->Write(".sysconfig.openldap", undef);
- Progress->NextStage();
+ Progress->NextStage();
- $rc = SCR->Execute('.target.bash', 'rm -rf /etc/openldap/slapd.d/cn=config*' );
- if ( $rc )
- {
- y2error("Error while cleaning up to config directory");
- $self->SetError( _("Config Directory cleanup failed.") );
- Progress->Finish();
- return 0;
- }
+ my $rc = SCR->Write('.sysconfig.openldap.OPENLDAP_CONFIG_BACKEND', 'ldap');
+ if ( ! $rc )
+ {
+ y2error("Error while switch to config backend");
+ $self->SetError( _("Switch from slapd.conf to config backend failed.") );
+ Progress->Finish();
+ return 0;
+ }
+ $rc = SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'yes');
+ if ( ! $rc )
+ {
+ y2error("Error while enabling LDAPI listener");
+ $self->SetError( _("Enabling thi LDAPI Protocol listener failed.") );
+ Progress->Finish();
+ return 0;
+ }
+ $rc = SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAPI');
+ y2milestone(Data::Dumper->Dump([$rc]));
- Progress->NextStage();
- $rc = SCR->Execute('.target.bash_output', 'mktemp /tmp/slapd-conf-ldif.XXXXXX' );
- if ( $rc->{'exit'} == 0 )
- {
- my $tmpfile = $rc->{'stdout'};
- chomp $tmpfile;
- y2milestone("using tempfile: ".$tmpfile );
- my $ldif = SCR->Read('.ldapserver.configAsLdif' );
- y2milestone($ldif);
- $rc = SCR->Write('.target.string', $tmpfile, $ldif );
+ # FIXME:
+ # Explicit cache flush, see bnc#350581 for details
+ SCR->Write(".sysconfig.openldap", undef);
+ Progress->NextStage();
+
+ $rc = SCR->Execute('.target.bash', 'rm -rf /etc/openldap/slapd.d/cn=config*' );
if ( $rc )
{
- $rc = SCR->Execute('.target.bash_output',
- "/usr/sbin/slapadd -F /etc/openldap/slapd.d -b cn=config -l $tmpfile" );
- if ( $rc->{'exit'} )
+ y2error("Error while cleaning up to config directory");
+ $self->SetError( _("Config Directory cleanup failed.") );
+ Progress->Finish();
+ return 0;
+ }
+
+ Progress->NextStage();
+ $rc = SCR->Execute('.target.bash_output', 'mktemp /tmp/slapd-conf-ldif.XXXXXX' );
+ if ( $rc->{'exit'} == 0 )
+ {
+ my $tmpfile = $rc->{'stdout'};
+ chomp $tmpfile;
+ y2milestone("using tempfile: ".$tmpfile );
+ my $ldif = SCR->Read('.ldapserver.configAsLdif' );
+ y2milestone($ldif);
+ $rc = SCR->Write('.target.string', $tmpfile, $ldif );
+ if ( $rc )
+ {
+ $rc = SCR->Execute('.target.bash_output',
+ "/usr/sbin/slapadd -F /etc/openldap/slapd.d -b cn=config -l $tmpfile" );
+ if ( $rc->{'exit'} )
+ {
+ y2error("Error during slapadd:" .$rc->{'stderr'});
+ $ret = 0;
+ }
+ }
+ else
{
- y2error("Error during slapadd:" .$rc->{'stderr'});
+ y2error("Error while write configuration to LDIF file");
$ret = 0;
}
+ # cleanup
+ SCR->Execute('.target.bash', "rm -f $tmpfile" );
}
- else
+ Progress->NextStage();
+
+ $rc = Service->Enable("ldap");
+ if ( ! $rc )
{
- y2error("Error while write configuration to LDIF file");
- $ret = 0;
+ y2error("Error while enabing the LDAP Service: ". Service->Error() );
+ $self->SetError( _("Enabling the LDAP Service failed.") );
+ Progress->Finish();
+ return 0;
+ }
+ $rc = Service->Restart("ldap");
+ if (! $rc )
+ {
+ y2error("Error while starting the LDAP service");
+ $self->SetError( _("Starting the LDAP service failed.") );
+ Progress->Finish();
+ return 0;
}
- # cleanup
- SCR->Execute('.target.bash', "rm -f $tmpfile" );
- }
- Progress->NextStage();
- $rc = Service->Enable("ldap");
- if ( ! $rc )
- {
- y2error("Error while enabing the LDAP Service: ". Service->Error() );
- $self->SetError( _("Enabling the LDAP Service failed.") );
- Progress->Finish();
- return 0;
- }
- $rc = Service->Restart("ldap");
- if (! $rc )
- {
- y2error("Error while starting the LDAP service");
- $self->SetError( _("Starting the LDAP service failed.") );
Progress->Finish();
- return 0;
+ } else {
+ SCR->Execute('.ldapserver.commitChanges' );
}
-
- Progress->Finish();
sleep(1);
return $ret;
}
@@ -503,12 +508,24 @@
}
BEGIN { $TYPEINFO {GetDatabase} = ["function", [ "map" , "string", "string"], "integer" ]; }
-sub GetDatabase{
+sub GetDatabase
+{
my ($self, $index) = @_;
y2milestone("GetDatabase ".$index);
- my $rc = SCR->Read(".ldapserver.database", YaST::YCP::Integer($index) );
+ my $rc = SCR->Read(".ldapserver.database.{".$index."}" );
y2milestone( "Database: ".Data::Dumper->Dump([$rc]) );
return $rc;
}
+
+BEGIN { $TYPEINFO {UpdateDatabase} = ["function", "boolean", "integer", [ "map" , "string", "string"] ]; }
+sub UpdateDatabase
+{
+ my ($self, $index, $changes) = @_;
+ my $rc = SCR->Write(".ldapserver.database.{".$index."}", $changes);
+ y2milestone( "Database: ".Data::Dumper->Dump([$rc]) );
+ return $rc;
+
+}
+
1;
# EOF
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 15:57:30 2008
@@ -96,6 +96,9 @@
} else if ( path->component_str(0) == "global" ) {
y2milestone("Global Write");
return WriteGlobal(path->at(1), arg, arg2);
+ } else if ( path->component_str(0) == "database" ) {
+ y2milestone("Database Write");
+ return WriteDatabase(path->at(1), arg, arg2);
} else {
return YCPNull();
}
@@ -190,6 +193,14 @@
}
}
}
+ else if ( path->component_str(0) == "commitChanges" )
+ {
+ OlcDatabaseList::const_iterator i;
+ for ( i = databases.begin(); i != databases.end() ; i++ )
+ {
+ olc.updateEntry(**i);
+ }
+ }
return YCPBoolean(true);
}
@@ -278,12 +289,28 @@
{
y2milestone("Path %s Length %ld ", path->toString().c_str(),
path->length());
- int index = arg->asInteger()->value();
- y2milestone("Database to read: %d", index);
+ std::string dbIndexStr = path->component_str(0);
+ int dbIndex = -2;
+ if ( dbIndexStr[0] == '{' )
+ {
+ std::string::size_type pos = dbIndexStr.find('}');
+ std::istringstream indexstr(dbIndexStr.substr(1, pos-1));
+ indexstr >> dbIndex;
+ } else {
+ y2error("Database Index expected, got: %s", dbIndexStr.c_str() );
+ return YCPNull();
+ }
+ if ( dbIndex < -1 )
+ {
+ y2error("Invalid database index: %d", dbIndex );
+ return YCPNull();
+ }
+
+ y2milestone("Database to read: %d", dbIndex);
OlcDatabaseList::const_iterator i;
for ( i = databases.begin(); i != databases.end() ; i++ )
{
- if ( (*i)->getIndex() == index )
+ if ( (*i)->getIndex() == dbIndex )
{
YCPMap resMap;
resMap.add( YCPString("suffix"),
@@ -324,6 +351,46 @@
return YCPBoolean(false);
}
+YCPBoolean SlapdConfigAgent::WriteDatabase( const YCPPath &path,
+ const YCPValue &arg,
+ const YCPValue &arg2)
+{
+ y2milestone("Path %s Length %ld ", path->toString().c_str(),
+ path->length());
+ std::string dbIndexStr = path->component_str(0);
+ YCPMap changesMap= arg->asMap();
+ int dbIndex = -2;
+ if ( dbIndexStr[0] == '{' )
+ {
+ std::string::size_type pos = dbIndexStr.find('}');
+ std::istringstream indexstr(dbIndexStr.substr(1, pos-1));
+ indexstr >> dbIndex;
+ } else {
+ y2error("Database Index expected, got: %s", dbIndexStr.c_str() );
+ return YCPNull();
+ }
+ if ( dbIndex < -1 )
+ {
+ y2error("Invalid database index: %d", dbIndex );
+ return YCPNull();
+ }
+
+ y2milestone("Database to write: %d", dbIndex);
+ OlcDatabaseList::const_iterator i;
+ for ( i = databases.begin(); i != databases.end() ; i++ )
+ {
+ if ( (*i)->getIndex() == dbIndex )
+ {
+ YCPValue val = changesMap.value( YCPString("rootdn") );
+ if ( val->isString() )
+ {
+ (*i)->setStringValue( "olcRootDn", val->asString()->value_cstr() );
+ }
+ }
+ }
+ return YCPBoolean(false);
+}
+
YCPString SlapdConfigAgent::ConfigToLdif() const
{
y2milestone("ConfigToLdif");
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 15:57:30 2008
@@ -49,6 +49,9 @@
YCPBoolean WriteGlobal( const YCPPath &path,
const YCPValue &arg = YCPNull(),
const YCPValue &opt = YCPNull());
+ YCPBoolean WriteDatabase( const YCPPath &path,
+ const YCPValue &arg = YCPNull(),
+ const YCPValue &opt = YCPNull());
YCPString ConfigToLdif() const;
private:
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 15:57:30 2008
@@ -501,7 +501,7 @@
return ldifStream.str();
}
-LDAPModList OlcConfigEntry::entryDifftoMod() {
+LDAPModList OlcConfigEntry::entryDifftoMod() const {
LDAPAttributeList::const_iterator i = m_dbEntry.getAttributes()->begin();
LDAPModList modifications;
for(; i != m_dbEntry.getAttributes()->end(); i++ )
@@ -613,6 +613,17 @@
}
}
+void OlcConfig::updateEntry( const OlcConfigEntry &oce )
+{
+ try {
+ LDAPModList ml = oce.entryDifftoMod();
+ m_lc->modify( oce.getDn(), &ml );
+ } catch (LDAPException e) {
+ std::cout << e << std::endl;
+ throw;
+ }
+}
+
OlcDatabaseList OlcConfig::getDatabases()
{
OlcDatabaseList res;
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 15:57:30 2008
@@ -21,10 +21,10 @@
inline OlcConfigEntry() : m_dbEntry(), m_dbEntryChanged() {}
inline OlcConfigEntry(const LDAPEntry& le) : m_dbEntry(le), m_dbEntryChanged(le) {}
- inline std::string getDn() {
+ inline std::string getDn() const {
return m_dbEntry.getDN();
}
- LDAPModList entryDifftoMod();
+ LDAPModList entryDifftoMod() const;
StringList getStringValues(const std::string &type) const;
void setStringValues(const std::string &type, const StringList &values);
@@ -127,6 +127,7 @@
OlcConfig(LDAPConnection *lc=0 );
OlcGlobalConfig getGlobals();
void setGlobals( OlcGlobalConfig &olcg);
+ void updateEntry( const OlcConfigEntry &oce );
OlcDatabaseList getDatabases();
private:
LDAPConnection *m_lc;
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 15:57:30 2008
@@ -747,7 +747,16 @@
map<string,string> db = $[];
db["rootdn"] = (string)UI::QueryWidget( `te_rootdn, `Value );
+ if( db["rootdn"]:"" != "" && (boolean)UI::QueryWidget( `cb_append_basedn, `Value ) )
+ {
+ string suffix = (string)widget_map[current_tree_item,"name"]:"";
+ db["rootdn"] = db["rootdn"]:"" + "," + suffix;
+ }
+
y2milestone( "updated Database: %1", db );
+
+ boolean res = LdapServer::UpdateDatabase( index, db);
+
// boolean is_new_db = (boolean)widget_map[current_tree_item,"new_db"]:nil;
// y2debug( "widget_map entry for item '%1': '%2'", suffix, widget_map[current_tree_item]:nil );
// if( is_new_db == nil )
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48602 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc agent/SlapdConfigAgent.h complex.ycp tree_structure.ycp widgets.ycp
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:25 2008
New Revision: 48602
URL: http://svn.opensuse.org/viewcvs/yast?rev=48602&view=rev
Log:
Very basic read support for Databases
Modified:
trunk/ldap-server/src/LdapServer.pm
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/agent/SlapdConfigAgent.h
trunk/ldap-server/src/complex.ycp
trunk/ldap-server/src/tree_structure.ycp
trunk/ldap-server/src/widgets.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 15:57:25 2008
@@ -71,6 +71,10 @@
$slapdConfChanged = 1;
# How do we get the LDAP password?
y2milestone("LDAP server is running. How should I connect?");
+ SCR->Execute('.ldapserver.init' );
+ my $rc = SCR->Read('.ldapserver.databases');
+ y2milestone("Databases: ". Data::Dumper->Dump([$rc]));
+ @databases = @{$rc};
}
else
{
@@ -485,7 +489,9 @@
my $ret = ();
foreach my $db ( @databases )
{
- my $tmp = { 'type' => $db->{'type'}, 'suffix' => $db->{'suffix'} };
+ my $tmp = { 'type' => $db->{'type'},
+ 'suffix' => $db->{'suffix'},
+ 'index' => $db->{'index'} };
if (! $tmp->{'suffix'} )
{
$tmp->{'suffix'} = "unknown";
@@ -495,5 +501,14 @@
y2milestone(Data::Dumper->Dump([$ret]));
return $ret
}
+
+BEGIN { $TYPEINFO {GetDatabase} = ["function", [ "map" , "string", "string"], "integer" ]; }
+sub GetDatabase{
+ my ($self, $index) = @_;
+ y2milestone("GetDatabase ".$index);
+ my $rc = SCR->Read(".ldapserver.database", YaST::YCP::Integer($index) );
+ y2milestone( "Database: ".Data::Dumper->Dump([$rc]) );
+ return $rc;
+}
1;
# EOF
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 15:57:25 2008
@@ -70,6 +70,11 @@
{
y2milestone("read databases");
return ReadDatabases(path->at(1), arg, opt);
+ }
+ else if ( path->component_str(0) == "database" )
+ {
+ y2milestone("read database");
+ return ReadDatabase(path->at(1), arg, opt);
}
else if ( path->component_str(0) == "configAsLdif" )
{
@@ -267,6 +272,32 @@
return dbList;
}
+YCPValue SlapdConfigAgent::ReadDatabase( const YCPPath &path,
+ const YCPValue &arg,
+ const YCPValue &opt)
+{
+ y2milestone("Path %s Length %ld ", path->toString().c_str(),
+ path->length());
+ int index = arg->asInteger()->value();
+ y2milestone("Database to read: %d", index);
+ OlcDatabaseList::const_iterator i;
+ for ( i = databases.begin(); i != databases.end() ; i++ )
+ {
+ if ( (*i)->getIndex() == index )
+ {
+ YCPMap resMap;
+ resMap.add( YCPString("suffix"),
+ YCPString( (*i)->getStringValue("olcSuffix") ));
+ resMap.add( YCPString("directory"),
+ YCPString( (*i)->getStringValue("olcDbDirectory") ));
+ resMap.add( YCPString("rootdn"),
+ YCPString( (*i)->getStringValue("olcRootDn") ));
+ return resMap;
+ }
+ }
+ return YCPNull();
+}
+
YCPBoolean SlapdConfigAgent::WriteGlobal( const YCPPath &path,
const YCPValue &arg,
const YCPValue &arg2)
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 15:57:25 2008
@@ -43,6 +43,9 @@
YCPValue ReadDatabases( const YCPPath &path,
const YCPValue &arg = YCPNull(),
const YCPValue &opt = YCPNull());
+ YCPValue ReadDatabase( const YCPPath &path,
+ const YCPValue &arg = YCPNull(),
+ const YCPValue &opt = YCPNull());
YCPBoolean WriteGlobal( const YCPPath &path,
const YCPValue &arg = YCPNull(),
const YCPValue &opt = YCPNull());
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 15:57:25 2008
@@ -194,14 +194,14 @@
return `abort;
}
}
- else
+ else if (! configModified )
{
// Start new config wizward
LdapServer::InitDbDefaults();
return `initial;
}
- return ret ? `next : `abort;
+ return `next;
}
/**
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 15:57:25 2008
@@ -42,7 +42,7 @@
*/
define string current_tree_item = "";
-define void addDatabaseWidgetMap( string suffix, string item_map, boolean new_db );
+//define void addDatabaseWidgetMap( string suffix, string item_map, integer index, boolean new_db );
/*********************************
** callback handlers **
@@ -733,17 +733,21 @@
define boolean cb_write_db()
``{
- string suffix = (string)widget_map[current_tree_item,"name"]:nil;
- // if( suffix == nil )
- // {
- // /* Error Popup */
- // callback_error = _("Unable to write settings for the current database.");
- // y2error( "'name' entry for item '%1' is nil", current_tree_item );
- // return false;
- // }
+ integer index = (integer)widget_map[current_tree_item,"index"]:nil;
+ y2milestone( "calling db write handler for '%1'", current_tree_item );
- // y2milestone( "calling db write handler for suffix '%1'", suffix );
+ if( index == nil )
+ {
+ /* Error Popup */
+ callback_error = _("Unable to write settings for the current database.");
+ y2error( "'name' entry for item '%1' is nil", current_tree_item );
+ return false;
+ }
+
+ map<string,string> db = $[];
+ db["rootdn"] = (string)UI::QueryWidget( `te_rootdn, `Value );
+ y2milestone( "updated Database: %1", db );
// boolean is_new_db = (boolean)widget_map[current_tree_item,"new_db"]:nil;
// y2debug( "widget_map entry for item '%1': '%2'", suffix, widget_map[current_tree_item]:nil );
// if( is_new_db == nil )
@@ -847,6 +851,18 @@
define boolean cb_read_db()
``{
+ y2milestone("cb_read_db current item: %1", current_tree_item);
+ integer index = (integer) widget_map[current_tree_item, "index"]:nil;
+
+ if ( index == nil )
+ {
+ callback_error = _("Unable to read settings for the current database.");
+ y2error( "'index' entry for item '%1' is nil", current_tree_item );
+ return false;
+ }
+
+ map<string, string> db = LdapServer::GetDatabase( index );
+
// string suffix = (string)widget_map[current_tree_item,"name"]:nil;
// if( suffix == nil )
// {
@@ -878,18 +894,18 @@
// return false;
// }
//
-// UI::ChangeWidget( `te_basedn, `Value, suffix );
-//
-// string rootdn = (string)db["rootdn"]:"";
-// boolean append_checked = false;
-// integer pos = find( rootdn, suffix );
-// if( pos > -1 )
-// {
-// rootdn = substring( rootdn, 0, pos-1 );
-// append_checked = true;
-// }
-// UI::ChangeWidget( `te_rootdn, `Value, rootdn );
-// UI::ChangeWidget( `cb_append_basedn, `Value, append_checked );
+ UI::ChangeWidget( `te_basedn, `Value, db["suffix"]:"" );
+
+ string rootdn = db["rootdn"]:"";
+ boolean append_checked = false;
+ integer pos = find( rootdn, db["suffix"]:"" );
+ if( pos > -1 )
+ {
+ rootdn = substring( rootdn, 0, pos-1 );
+ append_checked = true;
+ }
+ UI::ChangeWidget( `te_rootdn, `Value, rootdn );
+ UI::ChangeWidget( `cb_append_basedn, `Value, append_checked );
// UI::ChangeWidget( `te_rootpw, `Value, db["passwd"]:"" );
// UI::ChangeWidget( `te_valid_rootpw, `Value, db["passwd"]:"" );
// UI::ChangeWidget( `cb_cryptmethod, `Value, (string)db["cryptmethod"]:"SSHA" );
@@ -1031,12 +1047,13 @@
* tree generation functions **
*****************************************/
-void addDatabaseWidgetMap( string suffix, string item_name, boolean new_db )
+void addDatabaseWidgetMap( string suffix, string item_name, integer index, boolean new_db )
{
- if( haskey( widget_map, suffix ) ) return;
+ if( haskey( widget_map, item_name ) ) return;
map<string,any> item_map = $[
"name" : suffix,
+ "index" : index,
"widget" : editDbWidget,
"new_db" : new_db,
"dynamic" : true,
@@ -1062,7 +1079,7 @@
foreach( map<string,string> db, dblist, {
string tmp = sformat("%1 (%2)", db["suffix"]:"", db["type"]:"" );
string name = "database-" + tostring(i);
- addDatabaseWidgetMap( tmp , name, false );
+ addDatabaseWidgetMap( tmp , name, tointeger(db["index"]:"0"), false );
i = i+1;
} );
y2debug( "databases map is '%1'", (map<string,any>)widget_map["databases"]:$[] );
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 15:57:25 2008
@@ -29,7 +29,7 @@
`Left( `RadioButton( `id( `rb_yes ), `opt( `notify ), Label::YesButton(), LdapServer::ReadServiceEnabled() ) )
)
),
- `Left( `CheckBox( `id( `cb_register_slp ), _("Register at an &SLP Daemon"), LdapServer::ReadSLPEnabled() )),
+// `Left( `CheckBox( `id( `cb_register_slp ), _("Register at an &SLP Daemon"), LdapServer::ReadSLPEnabled() )),
`HStretch()
)
)
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r48601 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc agent/SlapdConfigAgent.h lib/backConfigTest.cpp lib/backConfigTest.h
by rhafer@svn.opensuse.org 27 Jun '08
by rhafer@svn.opensuse.org 27 Jun '08
27 Jun '08
Author: rhafer
Date: Fri Jun 27 15:57:20 2008
New Revision: 48601
URL: http://svn.opensuse.org/viewcvs/yast?rev=48601&view=rev
Log:
- Use SASL External Authentication for LDAP Connection
- Reworked .ldapserver.databases Code
Modified:
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/agent/SlapdConfigAgent.h
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 15:57:20 2008
@@ -4,12 +4,41 @@
#include <LdifReader.h>
#include <LdifWriter.h>
#include <LDAPEntry.h>
+#include <SaslInteraction.h>
#include <sstream>
#define DEFAULT_PORT 389
#define ANSWER 42
#define MAX_LENGTH_ID 5
+class SaslExternalHandler : SaslInteractionHandler
+{
+ public:
+ virtual void handleInteractions(const std::list<SaslInteraction*> &cb );
+ virtual ~SaslExternalHandler();
+ private:
+ std::list<SaslInteraction*> cleanupList;
+
+};
+
+void SaslExternalHandler::handleInteractions( const std::list<SaslInteraction *> &cb )
+{
+ std::list<SaslInteraction*>::const_iterator i;
+
+ for (i = cb.begin(); i != cb.end(); i++ ) {
+ cleanupList.push_back(*i);
+ }
+}
+
+SaslExternalHandler::~SaslExternalHandler()
+{
+ std::list<SaslInteraction*>::const_iterator i;
+ for (i = cleanupList.begin(); i != cleanupList.end(); i++ ) {
+ delete(*i);
+ }
+}
+
+
SlapdConfigAgent::SlapdConfigAgent()
{
y2milestone("SlapdConfigAgent::SlapdConfigAgent");
@@ -72,6 +101,14 @@
const YCPValue &arg2)
{
y2milestone("Execute Path %s", path->toString().c_str() );
+ if ( path->component_str(0) == "init" )
+ {
+
+ LDAPConnection *lc = new LDAPConnection("ldapi:///");
+ SaslExternalHandler sih;
+ lc->saslInteractiveBind("external", 2 /* LDAP_SASL_QUIET */, (SaslInteractionHandler*)&sih);
+ olc = OlcConfig(lc);
+ }
if ( path->component_str(0) == "initFromLdif" )
{
std::istringstream ldifstream(arg->asString()->value_cstr());
@@ -213,25 +250,18 @@
{
y2milestone("Path %s Length %ld ", path->toString().c_str(),
path->length());
- std::list<boost::shared_ptr<OlcDatabase> >::const_iterator i;
+ if ( databases.size() == 0 )
+ {
+ databases = olc.getDatabases();
+ }
+ OlcDatabaseList::const_iterator i;
YCPList dbList;
for (i = databases.begin(); i != databases.end(); i++ )
{
YCPMap ymap;
- std::map<std::string, std::list<std::string> > dbMap = (*i)->toMap();
- std::map<std::string, std::list<std::string> >::const_iterator j;
- for ( j = dbMap.begin(); j != dbMap.end(); j++ )
- {
- YCPList l;
- YCPString type(j->first);
- std::list<std::string> vals = j->second;
- std::list<std::string>::const_iterator k;
- for (k = vals.begin(); k != vals.end(); k++ )
- {
- l.add(YCPString(*k));
- }
- ymap.add(type, l);
- }
+ ymap.add( YCPString("suffix"), YCPString((*i)->getSuffix()) );
+ ymap.add( YCPString("type"), YCPString((*i)->getType()) );
+ ymap.add( YCPString("index"), YCPInteger((*i)->getIndex()) );
dbList.add(ymap);
}
return dbList;
@@ -266,7 +296,7 @@
YCPString SlapdConfigAgent::ConfigToLdif() const
{
y2milestone("ConfigToLdif");
- std::list<boost::shared_ptr<OlcDatabase> >::const_iterator i = databases.begin();
+ OlcDatabaseList::const_iterator i = databases.begin();
std::ostringstream ldif;
ldif << globals->toLdif() << std::endl;
ldif << schemaBase->toLdif() << std::endl;
@@ -281,3 +311,4 @@
}
return YCPString(ldif.str());
}
+
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 15:57:20 2008
@@ -50,7 +50,7 @@
private:
OlcConfig olc;
- std::list<boost::shared_ptr<OlcDatabase> > databases;
+ OlcDatabaseList databases;
boost::shared_ptr<OlcGlobalConfig> globals;
boost::shared_ptr<OlcSchemaConfig> schemaBase;
};
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 15:57:20 2008
@@ -24,7 +24,20 @@
return false;
}
-OlcDatabase::OlcDatabase( const LDAPEntry& le=LDAPEntry()) : OlcConfigEntry(le) { }
+OlcDatabase::OlcDatabase( const LDAPEntry& le=LDAPEntry()) : OlcConfigEntry(le)
+{
+ std::string type(this->getStringValue("olcdatabase"));
+ if ( type[0] == '{' )
+ {
+ std::string::size_type pos = type.find('}');
+ std::istringstream indexstr(type.substr(1, pos-1));
+ indexstr >> entryIndex;
+ m_type = type.substr( pos+1, std::string::npos );
+ } else {
+ m_type = type;
+ entryIndex = 0;
+ }
+}
OlcDatabase::OlcDatabase( const std::string& type ) : m_type(type)
{
@@ -337,6 +350,11 @@
this->updateEntryDn();
}
+int OlcConfigEntry::getIndex() const
+{
+ return this->entryIndex;
+}
+
void OlcConfigEntry::updateEntryDn()
{
}
@@ -386,6 +404,16 @@
this->setStringValue("olcRootPW", rootpw);
}
+const std::string OlcDatabase::getSuffix() const
+{
+ return this->getStringValue("olcSuffix");
+}
+
+const std::string OlcDatabase::getType() const
+{
+ return this->m_type;
+}
+
std::map<std::string, std::list<std::string> > OlcBdbDatabase::toMap() const
{
std::map<std::string, std::list<std::string> > resMap =
@@ -585,8 +613,24 @@
}
}
-OlcBdbDatabase getDatabase(std::string &basedn)
+OlcDatabaseList OlcConfig::getDatabases()
{
+ OlcDatabaseList res;
+ try {
+ LDAPSearchResults *sr = m_lc->search( "cn=config",
+ LDAPConnection::SEARCH_ONE, "objectclass=olcDatabaseConfig" );
+ LDAPEntry *dbEntry;
+ while ( dbEntry = sr->getNext() )
+ {
+ std::cout << "Got Database Entry: " << dbEntry->getDN() << std::endl;
+ boost::shared_ptr<OlcDatabase> olce(OlcDatabase::createFromLdapEntry(*dbEntry));
+ res.push_back(olce);
+ }
+ } catch (LDAPException e ) {
+ std::cout << e << std::endl;
+ throw;
+ }
+ return res;
}
OlcTlsSettings::OlcTlsSettings( const OlcGlobalConfig &ogc )
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 15:57:20 2008
@@ -8,6 +8,7 @@
#include <map>
#include <vector>
#include <LDAPEntry.h>
+#include <boost/shared_ptr.hpp>
class OlcConfigEntry
{
@@ -35,6 +36,8 @@
void setIndex( int index );
void getEntryDn();
+ int getIndex() const;
+
virtual std::map<std::string, std::list<std::string> > toMap() const;
virtual std::string toLdif() const;
@@ -53,12 +56,16 @@
OlcDatabase( const LDAPEntry &le );
OlcDatabase( const std::string& type );
+
static bool isBdbDatabase( const LDAPEntry& le );
void setSuffix( const std::string &suffix);
void setRootDn( const std::string &rootdn);
void setRootPw( const std::string &rootpw);
+ const std::string getSuffix() const;
+ const std::string getType() const;
+
virtual std::map<std::string, std::list<std::string> > toMap() const;
protected:
@@ -114,12 +121,13 @@
OlcSchemaConfig();
};
+typedef std::list<boost::shared_ptr<OlcDatabase> > OlcDatabaseList;
class OlcConfig {
public:
OlcConfig(LDAPConnection *lc=0 );
OlcGlobalConfig getGlobals();
void setGlobals( OlcGlobalConfig &olcg);
- OlcBdbDatabase getDatabase(std::string &basedn);
+ OlcDatabaseList getDatabases();
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