summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2013-11-19 16:35:48 -0500
committerSpencer T Brody <spencer@10gen.com>2013-11-26 15:34:39 -0500
commit4794dea52363a8e5be65648f69d7f98421666964 (patch)
treecc27b38481faabc5f49c64e0f98ffdb3535d6b52 /src/mongo/db/auth
parent41c1172aad09331e0cfe23e82642a46fada91fd8 (diff)
downloadmongo-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.cpp5
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();
}