Author: rhafer
Date: Mon Oct 5 17:00:10 2009
New Revision: 58944
URL: http://svn.opensuse.org/viewcvs/yast?rev=58944&view=rev
Log:
Allow empty access levels, to create rules like:
access to * by * break
Modified:
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapDatabase.ycp
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.cpp
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.h
Modified: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapDatabase.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapDatabase.ycp?rev=58944&r1=58943&r2=58944&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapDatabase.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/LdapDatabase.ycp Mon Oct 5 17:00:10 2009
@@ -650,6 +650,7 @@
];
map accessId2String = $[
+ `access_empty : [ _("<empty>"), ""],
`access_none : [ _("No Access"), "none"],
`access_disclose : [ _("No Access (but disclose information on error)"), "disclose" ],
`access_auth : [ _("Authenticate"), "auth" ],
@@ -660,6 +661,7 @@
];
map accessString2Id = $[
+ "" : `access_empty,
"none" : `access_none,
"disclose" : `access_disclose,
"auth" : `access_auth,
@@ -682,7 +684,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]:"" ) );
}
@@ -1274,7 +1276,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: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.cpp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.cpp?rev=58944&r1=58943&r2=58944&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.cpp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.cpp Mon Oct 5 17:00:10 2009
@@ -599,7 +599,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" )
{
@@ -758,12 +759,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: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.h?rev=58944&r1=58943&r2=58944&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/lib/slapd-config.h Mon Oct 5 17:00:10 2009
@@ -157,7 +157,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@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org