From 0672061deb58aac931912bed68d014247c581968 Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Fri, 23 May 2014 13:17:22 -0400 Subject: SERVER-13961 Pass LockState to DBWrite and DBRead directly This is part of the changes to move LockState be part of OperationContext and not retrieved from TLS. --- src/mongo/db/auth/authz_session_external_state_server_common.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/auth/authz_session_external_state_server_common.cpp') diff --git a/src/mongo/db/auth/authz_session_external_state_server_common.cpp b/src/mongo/db/auth/authz_session_external_state_server_common.cpp index b5c6f6a4bc3..debef7d3120 100644 --- a/src/mongo/db/auth/authz_session_external_state_server_common.cpp +++ b/src/mongo/db/auth/authz_session_external_state_server_common.cpp @@ -31,6 +31,7 @@ #include "mongo/base/status.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/client.h" +#include "mongo/db/operation_context.h" #include "mongo/db/server_parameters.h" #include "mongo/util/debug_util.h" @@ -49,7 +50,7 @@ namespace { _allowLocalhost(enableLocalhostAuthBypass) {} AuthzSessionExternalStateServerCommon::~AuthzSessionExternalStateServerCommon() {} - void AuthzSessionExternalStateServerCommon::_checkShouldAllowLocalhost() { + void AuthzSessionExternalStateServerCommon::_checkShouldAllowLocalhost(OperationContext* txn) { if (!_authzManager->isAuthEnabled()) return; // If we know that an admin user exists, don't re-check. @@ -61,7 +62,7 @@ namespace { return; } - _allowLocalhost = !_authzManager->hasAnyPrivilegeDocuments(); + _allowLocalhost = !_authzManager->hasAnyPrivilegeDocuments(txn); if (_allowLocalhost) { ONCE { log() << "note: no users configured in admin.system.users, allowing localhost " -- cgit v1.2.1