diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-11-19 16:35:48 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-11-26 15:34:39 -0500 |
commit | 4794dea52363a8e5be65648f69d7f98421666964 (patch) | |
tree | cc27b38481faabc5f49c64e0f98ffdb3535d6b52 /src/mongo/db/auth | |
parent | 41c1172aad09331e0cfe23e82642a46fada91fd8 (diff) | |
download | mongo-4794dea52363a8e5be65648f69d7f98421666964.tar.gz |
SERVER-11381 Make grant/revokePrivilegesFromRole commands reject empty 'privileges' array
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r-- | src/mongo/db/auth/user_management_commands_parser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/auth/user_management_commands_parser.cpp b/src/mongo/db/auth/user_management_commands_parser.cpp index 6ad54f13724..002880c2050 100644 --- a/src/mongo/db/auth/user_management_commands_parser.cpp +++ b/src/mongo/db/auth/user_management_commands_parser.cpp @@ -584,6 +584,11 @@ namespace auth { if (!status.isOK()) { return status; } + if (!parsedPrivileges->size()) { + return Status(ErrorCodes::BadValue, + mongoutils::str::stream() << cmdName << " command requires a non-empty " + "\"privileges\" array"); + } return Status::OK(); } |