[yast-commit] r48642 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc lib/backConfigTest.cpp lib/backConfigTest.h
Author: rhafer Date: Fri Jun 27 16:00:08 2008 New Revision: 48642 URL: http://svn.opensuse.org/viewcvs/yast?rev=48642&view=rev Log: fixed creation of new password overlays Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc trunk/ldap-server/src/lib/backConfigTest.cpp trunk/ldap-server/src/lib/backConfigTest.h Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfig... ============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:00:08 2008 @@ -222,6 +222,11 @@ if ( globals ) olc.updateEntry( *globals ); + OlcSchemaList::const_iterator j; + for ( j = schema.begin(); j != schema.end() ; j++ ) + { + olc.updateEntry(**j); + } OlcDatabaseList::const_iterator i; for ( i = databases.begin(); i != databases.end() ; i++ ) { @@ -230,14 +235,10 @@ OlcOverlayList::const_iterator k; for ( k = overlays.begin(); k != overlays.end(); k++ ) { + y2milestone("Update overlay: %s", (*k)->getDn().c_str() ); olc.updateEntry(**k); } } - OlcSchemaList::const_iterator j; - for ( j = schema.begin(); j != schema.end() ; j++ ) - { - olc.updateEntry(**j); - } } return YCPBoolean(true); } @@ -745,34 +746,47 @@ { if ( (*j)->getType() == "ppolicy" ) { - YCPMap argMap = arg->asMap(); - y2milestone("Mapsize: %d", argMap.size()); - if ( argMap.size() == 0 ){ - y2milestone("Delete ppolicy overlay"); - (*j)->clearChangedEntry(); - } else { - (*j)->setStringValue("olcPpolicyDefault", - argMap->value(YCPString("defaultPolicy"))->asString()->value_cstr() ); - if ( argMap->value(YCPString("useLockout"))->asBoolean()->value() == true ) - { - (*j)->setStringValue("olcPpolicyUseLockout", "TRUE"); - } - else - { - (*j)->setStringValue("olcPpolicyUseLockout", "FALSE"); - } - if ( argMap->value(YCPString("hashClearText"))->asBoolean()->value() == true ) - { - (*j)->setStringValue("olcPpolicyHashCleartext", "TRUE"); - } - else - { - (*j)->setStringValue("olcPpolicyHashCleartext", "FALSE"); - } - } break; } } + boost::shared_ptr<OlcOverlay> ppolicyOlc; + if ( j == overlays.end() ) + { + y2milestone("New Overlay added"); + boost::shared_ptr<OlcOverlay> tmp(new OlcOverlay("ppolicy", (*i)->getDn())); + ppolicyOlc = tmp; + (*i)->addOverlay(ppolicyOlc); + } + else + { + y2milestone("Update existing Overlay"); + ppolicyOlc = *j; + } + YCPMap argMap = arg->asMap(); + y2milestone("Mapsize: %d", argMap.size()); + if ( argMap.size() == 0 ){ + y2milestone("Delete ppolicy overlay"); + ppolicyOlc->clearChangedEntry(); + } else { + ppolicyOlc->setStringValue("olcPpolicyDefault", + argMap->value(YCPString("defaultPolicy"))->asString()->value_cstr() ); + if ( argMap->value(YCPString("useLockout"))->asBoolean()->value() == true ) + { + ppolicyOlc->setStringValue("olcPpolicyUseLockout", "TRUE"); + } + else + { + ppolicyOlc->setStringValue("olcPpolicyUseLockout", "FALSE"); + } + if ( argMap->value(YCPString("hashClearText"))->asBoolean()->value() == true ) + { + ppolicyOlc->setStringValue("olcPpolicyHashCleartext", "TRUE"); + } + else + { + ppolicyOlc->setStringValue("olcPpolicyHashCleartext", "FALSE"); + } + } ret = true; } else Modified: trunk/ldap-server/src/lib/backConfigTest.cpp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTes... ============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.cpp (original) +++ trunk/ldap-server/src/lib/backConfigTest.cpp Fri Jun 27 16:00:08 2008 @@ -567,6 +567,16 @@ entryIndex = splitIndexFromString( type, m_type ); } +OlcOverlay::OlcOverlay( const std::string &type, const std::string &parent ) + : m_type(type) +{ + std::ostringstream dnstr; + dnstr << "olcOverlay=" << m_type << "," << parent; + m_dbEntryChanged.setDN(dnstr.str()); + m_dbEntryChanged.addAttribute(LDAPAttribute("objectclass", "olcPpolicyConfig")); + m_dbEntryChanged.addAttribute(LDAPAttribute("olcoverlay", m_type)); +} + const std::string OlcOverlay::getType() const { return m_type; Modified: trunk/ldap-server/src/lib/backConfigTest.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTes... ============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.h (original) +++ trunk/ldap-server/src/lib/backConfigTest.h Fri Jun 27 16:00:08 2008 @@ -82,6 +82,7 @@ public: static OlcOverlay* createFromLdapEntry( const LDAPEntry& le); OlcOverlay( const LDAPEntry &le ); + OlcOverlay( const std::string &type, const std::string &parent ); const std::string getType() const; protected: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
rhafer@svn.opensuse.org