1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

Feature #687: Add correctness check for ACL rule rights

This commit is contained in:
Carlos Martín 2011-06-30 11:53:18 +02:00
parent 348e0aaebc
commit 7520a50dd3

View File

@ -163,6 +163,30 @@ bool AclRule::malformed(string& error_str) const
oss << "wrong [resource] type";
}
// Check rights
if ( rights == 0 )
{
if ( error )
{
oss << "; ";
}
error = true;
oss << "wrong [rights], it cannot be 0";
}
if ( rights > 0x1FFLL )
{
if ( error )
{
oss << "; ";
}
error = true;
oss << "wrong [rights], it cannot be bigger than 0x1FF";
}
if ( error )
{
error_str = oss.str();