Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-12118 Better error message when invalid user doc detected duri…

…ng authSchemaUpgrade
  • Loading branch information...
commit 1e7aec1f31aa2794cdb3ca59d823d125d7896b58 1 parent 2399d0d
@stbrody stbrody authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/mongo/client/auth_helpers.cpp
View
8 src/mongo/client/auth_helpers.cpp
@@ -86,6 +86,14 @@ namespace auth {
oldUserDoc.toString(),
!oldUserDoc.hasField("credentials"));
+ uassert(17386,
+ mongoutils::str::stream() << "While preparing to upgrade user doc from "
+ "the 2.4 user data schema to the 2.6 schema, found a user doc "
+ "that doesn't conform to the 2.4 *or* 2.6 schema. Doc found: "
+ << oldUserDoc.toString(),
+ oldUserDoc.hasField("user") &&
+ (oldUserDoc.hasField("userSource") || oldUserDoc.hasField("pwd")));
+
std::string oldUserSource;
uassertStatusOK(bsonExtractStringFieldWithDefault(
oldUserDoc,
Please sign in to comment.
Something went wrong with that request. Please try again.