Mailinglist Archive: yast-commit (459 mails)

< Previous Next >
[yast-commit] r60784 - in /trunk/ldap-server: ./ src/LdapDatabase.ycp src/agent/SlapdConfigAgent.cc src/lib/slapd-config.cpp src/lib/slapd-config.h
  • From: rhafer@xxxxxxxxxxxxxxxx
  • Date: Wed, 10 Feb 2010 12:24:02 -0000
  • Message-id: <E1NfBbu-0003uQ-FY@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Wed Feb 10 13:24:01 2010
New Revision: 60784

URL: http://svn.opensuse.org/viewcvs/yast?rev=60784&view=rev
Log:
Merged ACL enhancments from sle-11-sp1 branch

Modified:
trunk/ldap-server/ (props changed)
trunk/ldap-server/src/LdapDatabase.ycp
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/LdapDatabase.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapDatabase.ycp?rev=60784&r1=60783&r2=60784&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapDatabase.ycp (original)
+++ trunk/ldap-server/src/LdapDatabase.ycp Wed Feb 10 13:24:01 2010
@@ -625,6 +625,7 @@
];

map<symbol, list<string> > accessId2String = $[
+ `access_empty : [ _("<empty>"), ""],
`access_none : [ _("No Access"), "none"],
`access_disclose : [ _("No Access (but disclose information on
error)"), "disclose" ],
`access_auth : [ _("Authenticate"), "auth" ],
@@ -635,6 +636,7 @@
];

map<string, symbol> accessString2Id = $[
+ "" : `access_empty,
"none" : `access_none,
"disclose" : `access_disclose,
"auth" : `access_auth,
@@ -657,7 +659,7 @@
);

list access_itemlist = [];
- foreach( symbol i, [`access_none, `access_disclose, `access_auth,
`access_compare, `access_read, `access_write, `access_manage ] ,
+ foreach( symbol i, [`access_empty, `access_none, `access_disclose,
`access_auth, `access_compare, `access_read, `access_write, `access_manage ] ,
{
access_itemlist = add(access_itemlist, `item( `id( i ),
accessId2String[i,0]:"" ) );
}
@@ -1249,7 +1251,7 @@
foreach( map acl, acllist,
{
y2milestone( "------------------------------" );
- y2milestone( "ACL Target: %1", acl["target","what"]:`nil );
+ y2milestone( "ACL Target: %1", acl["target","what"]:"<nul>");
map targetmap = $[];
if ( acl["target","what"]:"*" != "*" )
{

Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfigAgent.cc?rev=60784&r1=60783&r2=60784&view=diff
==============================================================================
--- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original)
+++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Wed Feb 10 13:24:01 2010
@@ -838,6 +838,7 @@
byMap.add(YCPString("level"), YCPString(
(*k)->getLevel() ) );
byMap.add(YCPString("type"), YCPString(
(*k)->getType() ) );
byMap.add(YCPString("value"), YCPString(
(*k)->getValue() ) );
+ byMap.add(YCPString("control"), YCPString(
(*k)->getControl() ) );
accessList.add(byMap);
}
aclMap.add( YCPString("access"), accessList );
@@ -1680,8 +1681,15 @@
value =
accessList->value(k)->asMap()->value( YCPString("value")
)->asString()->value_cstr();
}
std::string level(
accessList->value(k)->asMap()->value( YCPString("level")
)->asString()->value_cstr() );
- y2debug("level %s, type %s, value %s",
level.c_str(), type.c_str(), value.c_str() );
- boost::shared_ptr<OlcAclBy> by( new OlcAclBy(
level, type, value ) );
+ std::string control( "stop" );
+ YCPValue
ctrlVal(accessList->value(k)->asMap()->value( YCPString("control") ) );
+ if ( ! ctrlVal.isNull() )
+ {
+ control =
ctrlVal->asString()->value_cstr() ;
+ }
+ y2debug("level %s, type %s, value %s control
%s",
+ level.c_str(), type.c_str(),
value.c_str(), control.c_str() );
+ boost::shared_ptr<OlcAclBy> by( new OlcAclBy(
level, type, value, control ) );
byList.push_back( by );
}
acl->setByList(byList);

Modified: trunk/ldap-server/src/lib/slapd-config.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config.cpp?rev=60784&r1=60783&r2=60784&view=diff
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.cpp (original)
+++ trunk/ldap-server/src/lib/slapd-config.cpp Wed Feb 10 13:24:01 2010
@@ -663,7 +663,8 @@
spos = tmppos+1;
tmppos = extractAlcToken( aclString, spos, false );
level = aclString.substr(spos, tmppos-spos);
- if ( level != "none" && level != "disclose" && level != "auth"
&&
+ if ( !level.empty() &&
+ level != "none" && level != "disclose" && level != "auth"
&&
level != "compare" && level != "read" &&
level != "write" && level != "manage" )
{
@@ -822,12 +823,14 @@
{
aclString << "=\"" << (*i)->getValue() << "\"";
}
-
- aclString << " " << (*i)->getLevel();
+ if ( ! (*i)->getLevel().empty() )
+ {
+ aclString << " " << (*i)->getLevel();
+ }
std::string control = (*i)->getControl();
if ( !control.empty() && control != "stop" )
{
- aclString << " " << (*i)->getControl();
+ aclString << " " << control;
}
}
return aclString.str();

Modified: trunk/ldap-server/src/lib/slapd-config.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config.h?rev=60784&r1=60783&r2=60784&view=diff
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.h (original)
+++ trunk/ldap-server/src/lib/slapd-config.h Wed Feb 10 13:24:01 2010
@@ -170,7 +170,8 @@
inline void setLevel( const std::string &level )
{

- if ( level != "none" && level != "disclose" && level != "auth" &&
+ if ( !level.empty() &&
+ level != "none" && level != "disclose" && level != "auth" &&
level != "compare" && level != "read" &&
level != "write" && level != "manage" )
{

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

< Previous Next >
This Thread
  • No further messages