summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authz_manager_external_state_local.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-04-28 16:36:11 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-05-05 10:29:06 -0400
commitf7a46a118288ba0ce45c7664777ea0e89c2eb845 (patch)
treed9ba6c6981072ce4b836617ebb1889ac17e4fcc2 /src/mongo/db/auth/authz_manager_external_state_local.cpp
parentf49018bca41048d8a4f729ccc0489ea6be073a20 (diff)
downloadmongo-f7a46a118288ba0ce45c7664777ea0e89c2eb845.tar.gz
SERVER-23610 CanonicalQuery should own a CollatorInterface
Diffstat (limited to 'src/mongo/db/auth/authz_manager_external_state_local.cpp')
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_local.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state_local.cpp b/src/mongo/db/auth/authz_manager_external_state_local.cpp
index 7525464f6bb..5d76027fc22 100644
--- a/src/mongo/db/auth/authz_manager_external_state_local.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_local.cpp
@@ -370,14 +370,16 @@ Status AuthzManagerExternalStateLocal::_initializeRoleGraph(OperationContext* tx
class AuthzManagerExternalStateLocal::AuthzManagerLogOpHandler : public RecoveryUnit::Change {
public:
- // None of the parameters below (except externalState) need to live longer than
- // the instantiations of this class
- AuthzManagerLogOpHandler(AuthzManagerExternalStateLocal* externalState,
+ // None of the parameters below (except txn and externalState) need to live longer than the
+ // instantiations of this class
+ AuthzManagerLogOpHandler(OperationContext* txn,
+ AuthzManagerExternalStateLocal* externalState,
const char* op,
const char* ns,
const BSONObj& o,
const BSONObj* o2)
- : _externalState(externalState),
+ : _txn(txn),
+ _externalState(externalState),
_op(op),
_ns(ns),
_o(o.getOwned()),
@@ -388,7 +390,7 @@ public:
virtual void commit() {
stdx::lock_guard<stdx::mutex> lk(_externalState->_roleGraphMutex);
Status status = _externalState->_roleGraph.handleLogOp(
- _op.c_str(), NamespaceString(_ns.c_str()), _o, _isO2Set ? &_o2 : NULL);
+ _txn, _op.c_str(), NamespaceString(_ns.c_str()), _o, _isO2Set ? &_o2 : NULL);
if (status == ErrorCodes::OplogOperationUnsupported) {
_externalState->_roleGraph = RoleGraph();
@@ -419,6 +421,7 @@ public:
virtual void rollback() {}
private:
+ OperationContext* _txn;
AuthzManagerExternalStateLocal* _externalState;
const std::string _op;
const std::string _ns;
@@ -432,7 +435,7 @@ void AuthzManagerExternalStateLocal::logOp(
OperationContext* txn, const char* op, const char* ns, const BSONObj& o, const BSONObj* o2) {
if (ns == AuthorizationManager::rolesCollectionNamespace.ns() ||
ns == AuthorizationManager::adminCommandNamespace.ns()) {
- txn->recoveryUnit()->registerChange(new AuthzManagerLogOpHandler(this, op, ns, o, o2));
+ txn->recoveryUnit()->registerChange(new AuthzManagerLogOpHandler(txn, this, op, ns, o, o2));
}
}