Added validation for VIEW_STANDALONE_CONTAINER ACL. Review: https://reviews.apache.org/r/64656
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/da538bdb Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/da538bdb Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/da538bdb Branch: refs/heads/master Commit: da538bdb898db47d619328f58310cc7dac4eb48c Parents: c07eab6 Author: Jie Yu <[email protected]> Authored: Fri Dec 15 11:05:46 2017 -0800 Committer: Jie Yu <[email protected]> Committed: Fri Dec 15 14:03:14 2017 -0800 ---------------------------------------------------------------------- src/authorizer/local/authorizer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/da538bdb/src/authorizer/local/authorizer.cpp ---------------------------------------------------------------------- diff --git a/src/authorizer/local/authorizer.cpp b/src/authorizer/local/authorizer.cpp index 329f91d..0722ac9 100644 --- a/src/authorizer/local/authorizer.cpp +++ b/src/authorizer/local/authorizer.cpp @@ -1667,6 +1667,14 @@ Option<Error> LocalAuthorizer::validate(const ACLs& acls) } } + foreach (const ACL::ViewStandaloneContainer& acl, + acls.view_standalone_containers()) { + if (acl.users().type() == ACL::Entity::SOME) { + return Error( + "acls.view_standalone_containers type must be either NONE or ANY"); + } + } + foreach (const ACL::ModifyResourceProviderConfig& acl, acls.modify_resource_provider_configs()) { if (acl.resource_providers().type() == ACL::Entity::SOME) {
