Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] r58783 - in /branches/tmp/SLE-11-SP1-Stash/ldap-server: ./ src/lib/slapd-config.cpp src/lib/slapd-config.h
  • From: rhafer@xxxxxxxxxxxxxxxx
  • Date: Fri, 25 Sep 2009 14:25:58 -0000
  • Message-id: <E1MrBkE-0008Ip-LW@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Fri Sep 25 16:25:58 2009
New Revision: 58783

URL: http://svn.opensuse.org/viewcvs/yast?rev=58783&view=rev
Log:
merged recent bugfixes from trunk (bnc#542165, bnc#541819)

Modified:
branches/tmp/SLE-11-SP1-Stash/ldap-server/ (props changed)
branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.cpp
branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.h

Modified: branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.cpp?rev=58783&r1=58782&r2=58783&view=diff
==============================================================================
--- branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.cpp
(original)
+++ branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.cpp Fri Sep
25 16:25:58 2009
@@ -1253,6 +1253,8 @@
tls.applySettings( *this );
}

+const std::string OlcSchemaConfig::schemabase = "cn=schema,cn=config";
+
OlcSchemaConfig::OlcSchemaConfig() : OlcConfigEntry()
{
m_dbEntryChanged.setDN("cn=schema,cn=config");
@@ -1264,21 +1266,44 @@
{
log_it(SLAPD_LOG_INFO, "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry
&e) : OlcConfigEntry(e)");
std::string name(this->getStringValue("cn"));
- if ( name[0] == '{' )
+ std::string dn(e.getDN() );
+ if ( name.empty() )
+ {
+ throw std::runtime_error( "Entry '" + dn + "' has no 'cn' Attribute."
);
+ }
+ if ( (dn.size() < schemabase.size()) ||
+ (dn.compare( dn.size()-schemabase.size(), schemabase.size(),
schemabase )) )
+ {
+ throw std::runtime_error( "Entry '" + dn + "' is not a child of '" +
schemabase + "'." );
+ }
+ if ( this->getStringValues("olcobjectclasses").empty() &&
+ this->getStringValues("olcattributetypes").empty() )
{
- std::string::size_type pos = name.find('}');
- std::istringstream indexstr(name.substr(1, pos-1));
- indexstr >> entryIndex;
- m_name = name.substr( pos+1, std::string::npos );
- } else {
- m_name = name;
- entryIndex = 0;
+ throw std::runtime_error( "Entry '" + dn + "' does not define any
objectclasses or attributetypes." );
}
+
+ entryIndex = splitIndexFromString( name, m_name );
}
OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry &e1, const LDAPEntry &e2) :
OlcConfigEntry(e1, e2)
{
- log_it(SLAPD_LOG_INFO, "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry
&e) : OlcConfigEntry(e)");
+ log_it(SLAPD_LOG_INFO, "OlcSchemaConfig::OlcSchemaConfig(const LDAPEntry
&e1, const LDAPEntry &e2) : OlcConfigEntry(e1, e2)" );
std::string name(this->getStringValue("cn"));
+ std::string dn(e2.getDN() );
+ if ( name.empty() )
+ {
+ throw std::runtime_error( "Entry '" + dn + "' has no 'cn' Attribute."
);
+ }
+ if ( (dn.size() < schemabase.size()) ||
+ (dn.compare( dn.size()-schemabase.size(), schemabase.size(),
schemabase )) )
+ {
+ throw std::runtime_error( "Entry '" + dn + "' is not a child of '" +
schemabase + "'." );
+ }
+ if ( this->getStringValues("olcobjectclasses").empty() &&
+ this->getStringValues("olcattributetypes").empty() )
+ {
+ throw std::runtime_error( "Entry '" + dn + "' does not define any
objectclasses or attributetypes." );
+ }
+
entryIndex = splitIndexFromString( name, m_name );
}


Modified: branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.h?rev=58783&r1=58782&r2=58783&view=diff
==============================================================================
--- branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.h (original)
+++ branches/tmp/SLE-11-SP1-Stash/ldap-server/src/lib/slapd-config.h Fri Sep 25
16:25:58 2009
@@ -292,6 +292,7 @@
virtual void clearChangedEntry();
const std::string& getName() const;
const std::vector<LDAPAttrType> getAttributeTypes() const;
+ static const std::string schemabase;

protected:
virtual void updateEntryDn( bool origEntry = false);

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

< Previous Next >
This Thread
  • No further messages