Author: rhafer Date: Mon May 11 14:18:52 2009 New Revision: 57115 URL: http://svn.opensuse.org/viewcvs/yast?rev=57115&view=rev Log: Error out when writing unsupported access levels (bnc#492441) Modified: trunk/ldap-server/src/lib/slapd-config.h Modified: trunk/ldap-server/src/lib/slapd-config.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config.... ============================================================================== --- trunk/ldap-server/src/lib/slapd-config.h (original) +++ trunk/ldap-server/src/lib/slapd-config.h Mon May 11 14:18:52 2009 @@ -128,7 +128,10 @@ inline OlcAclBy( const std::string& level, const std::string& type, const std::string& value = "" ) : - m_level(level), m_type(type), m_value(value) {}; + m_type(type), m_value(value) + { + setLevel(level); + } inline std::string getLevel() const { @@ -147,6 +150,13 @@ inline void setLevel( const std::string &level ) { + + if ( level != "none" && level != "disclose" && level != "auth" && + level != "compare" && level != "read" && + level != "write" && level != "manage" ) + { + throw std::runtime_error( "Unsupported access level" ); + } m_level = level; } inline void setType( const std::string &type ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org