diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-06-02 13:08:02 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-06-05 10:39:14 -0400 |
commit | d1f92647d5c337ce8ec21a60d81adf8de3c140f7 (patch) | |
tree | eea9a61d6b11be61feb47efc5e7f90c2a0bb5cb5 /src/mongo/db | |
parent | 459b9e9d0f2f1ae1cbca07f8728a6ca253871d30 (diff) | |
download | mongo-d1f92647d5c337ce8ec21a60d81adf8de3c140f7.tar.gz |
SERVER-13961 AuthzSessionExternalStateMongod::startRequest doesn't need a lock check
When called from DBDirectClient, it already skips the check if running
under isGod context.
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/auth/authz_session_external_state_d.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/auth/authz_session_external_state_d.cpp b/src/mongo/db/auth/authz_session_external_state_d.cpp index 614b5e67505..25db2ea0e2f 100644 --- a/src/mongo/db/auth/authz_session_external_state_d.cpp +++ b/src/mongo/db/auth/authz_session_external_state_d.cpp @@ -46,9 +46,10 @@ namespace mongo { AuthzSessionExternalStateMongod::~AuthzSessionExternalStateMongod() {} void AuthzSessionExternalStateMongod::startRequest(OperationContext* txn) { - if (!Lock::isLocked()) { - _checkShouldAllowLocalhost(txn); - } + // No locks should be held as this happens before any database accesses occur + fassert(17506, txn->lockState()->threadState() == 0); + + _checkShouldAllowLocalhost(txn); } bool AuthzSessionExternalStateMongod::shouldIgnoreAuthChecks() const { |