Navigation Menu

Skip to content

Commit

Permalink
SERVER-3730: Disallow himBHfields in modifier ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Hannan committed Sep 21, 2011
1 parent 1329db4 commit 55351e6
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 141 deletions.
1 change: 1 addition & 0 deletions db/ops/update.cpp
Expand Up @@ -814,6 +814,7 @@ namespace mongo {

const char * fieldName = f.fieldName();

uassert( 15896 , "Modified field name may not start with $", fieldName[0] != '$' || op == Mod::UNSET ); // allow remove of invalid field name in case it was inserted before this check was added (~ version 2.1)
uassert( 10148 , "Mod on _id not allowed", strcmp( fieldName, "_id" ) != 0 );
uassert( 10149 , "Invalid mod field name, may not end in a period", fieldName[ strlen( fieldName ) - 1 ] != '.' );
uassert( 10150 , "Field name duplication not allowed with modifiers", ! haveModForField( fieldName ) );
Expand Down

0 comments on commit 55351e6

Please sign in to comment.