summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authz_session_external_state_d.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-06-02 13:08:02 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-06-05 10:39:14 -0400
commitd1f92647d5c337ce8ec21a60d81adf8de3c140f7 (patch)
treeeea9a61d6b11be61feb47efc5e7f90c2a0bb5cb5 /src/mongo/db/auth/authz_session_external_state_d.cpp
parent459b9e9d0f2f1ae1cbca07f8728a6ca253871d30 (diff)
downloadmongo-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/auth/authz_session_external_state_d.cpp')
-rw-r--r--src/mongo/db/auth/authz_session_external_state_d.cpp7
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 {