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:
parent
348e0aaebc
commit
7520a50dd3
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user