summaryrefslogtreecommitdiff
path: root/src/mongo/s/cluster_write.cpp
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2014-03-07 15:22:54 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2014-03-10 14:29:32 -0400
commit629de3b0f493ad7517b2aecd6ec616df015f53dc (patch)
tree0b10092e401aa88eda32ce01acd07d6fe816f1ca /src/mongo/s/cluster_write.cpp
parentcc421d9723c67f0afa3efacc7ff4c766aceea332 (diff)
downloadmongo-629de3b0f493ad7517b2aecd6ec616df015f53dc.tar.gz
SERVER-12975 Write command to mongos checks invalid NS
Diffstat (limited to 'src/mongo/s/cluster_write.cpp')
-rw-r--r--src/mongo/s/cluster_write.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/s/cluster_write.cpp b/src/mongo/s/cluster_write.cpp
index 5d726737e67..6299208d6f9 100644
--- a/src/mongo/s/cluster_write.cpp
+++ b/src/mongo/s/cluster_write.cpp
@@ -325,6 +325,13 @@ namespace mongo {
return;
}
+ if ( !NamespaceString::validCollectionName( nss.coll() ) ) {
+ toBatchError( Status( ErrorCodes::BadValue,
+ str::stream() << "invalid collection name " << nss.coll() ),
+ response );
+ return;
+ }
+
string errMsg;
if ( request.isInsertIndexRequest() && !request.isValidIndexRequest( &errMsg ) ) {
toBatchError( Status( ErrorCodes::InvalidOptions, errMsg ), response );