diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2020-08-10 18:29:23 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-10 22:45:05 +0000 |
commit | 5eedf66fc4ae88a0eb0bdf42cb5b8f865379c762 (patch) | |
tree | db84c2b32ad7fee10246492363bc5c9b16f9f114 /src/mongo | |
parent | 4ca0dd7e041274d4ce7b87cf2f6494e6da30eaf0 (diff) | |
download | mongo-5eedf66fc4ae88a0eb0bdf42cb5b8f865379c762.tar.gz |
SERVER-50050 Fix non-ssl build
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/auth/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/auth/authorization_manager_impl.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/auth/authorization_manager_test.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/mongod_main.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/s/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/s/mongos_main.cpp | 2 | ||||
-rw-r--r-- | src/mongo/shell/mongo_main.cpp | 2 |
8 files changed, 16 insertions, 1 deletions
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript index 3123a63a5a6..8d4a2789baf 100644 --- a/src/mongo/db/auth/SConscript +++ b/src/mongo/db/auth/SConscript @@ -156,6 +156,7 @@ env.Library( '$BUILD_DIR/mongo/db/pipeline/lite_parsed_document_source', '$BUILD_DIR/mongo/db/update/update_driver', '$BUILD_DIR/mongo/util/icu', + '$BUILD_DIR/mongo/util/concurrency/thread_pool', '$BUILD_DIR/mongo/util/net/ssl_manager', '$BUILD_DIR/mongo/util/net/ssl_types', ], diff --git a/src/mongo/db/auth/authorization_manager_impl.cpp b/src/mongo/db/auth/authorization_manager_impl.cpp index 96ad1aa0e9d..a2ba1112eec 100644 --- a/src/mongo/db/auth/authorization_manager_impl.cpp +++ b/src/mongo/db/auth/authorization_manager_impl.cpp @@ -452,6 +452,7 @@ StatusWith<UserHandle> AuthorizationManagerImpl::acquireUser(OperationContext* o UserRequest request(userName, boost::none); +#ifdef MONGO_CONFIG_SSL // Clients connected via TLS may present an X.509 certificate which contains an authorization // grant. If this is the case, the roles must be provided to the external state, for expansion // into privileges. @@ -464,6 +465,7 @@ StatusWith<UserHandle> AuthorizationManagerImpl::acquireUser(OperationContext* o sslPeerInfo.roles.end(), std::inserter(*request.roles, request.roles->begin())); } +#endif auto cachedUser = _userCache.acquire(opCtx, request); invariant(cachedUser); diff --git a/src/mongo/db/auth/authorization_manager_test.cpp b/src/mongo/db/auth/authorization_manager_test.cpp index cf30c5fbf4d..b8fa754fb62 100644 --- a/src/mongo/db/auth/authorization_manager_test.cpp +++ b/src/mongo/db/auth/authorization_manager_test.cpp @@ -61,6 +61,7 @@ namespace mongo { namespace { +#ifdef MONGO_CONFIG_SSL // Construct a simple, structured X509 name equivalent to "CN=mongodb.com" SSLX509Name buildX509Name() { return SSLX509Name(std::vector<std::vector<SSLX509Name::Entry>>( @@ -72,6 +73,8 @@ void setX509PeerInfo(const transport::SessionHandle& session, SSLPeerInfo info) sslPeerInfo = info; } +#endif + class AuthorizationManagerTest : public ServiceContextTest { public: AuthorizationManagerTest() { @@ -193,7 +196,6 @@ TEST_F(AuthorizationManagerTest, testLocalX509Authorization) { ASSERT(privilegeIt != privileges.end()); ASSERT(privilegeIt->second.includesAction(ActionType::insert)); } -#endif TEST_F(AuthorizationManagerTest, testLocalX509AuthorizationInvalidUser) { setX509PeerInfo(session, @@ -212,6 +214,8 @@ TEST_F(AuthorizationManagerTest, testLocalX509AuthenticationNoAuthorization) { .getStatus()); } +#endif + /** * An implementation of AuthzManagerExternalStateMock that overrides the getUserDescription method * to return the user document unmodified from how it was inserted. When using this insert user diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp index 775e13d2021..52f7fd04579 100644 --- a/src/mongo/db/mongod_main.cpp +++ b/src/mongo/db/mongod_main.cpp @@ -340,8 +340,10 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) { auto runner = makePeriodicRunner(serviceContext); serviceContext->setPeriodicRunner(std::move(runner)); +#ifdef MONGO_CONFIG_SSL OCSPManager::get()->startThreadPool(); CertificateExpirationMonitor::get()->start(serviceContext); +#endif if (!storageGlobalParams.repair) { auto tl = diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index a63a654fc25..9938345d74b 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -1617,6 +1617,7 @@ env.Library( '$BUILD_DIR/mongo/executor/scoped_task_executor', '$BUILD_DIR/mongo/executor/thread_pool_task_executor', '$BUILD_DIR/mongo/s/write_ops/batch_write_types', + '$BUILD_DIR/mongo/util/concurrency/thread_pool', 'wait_for_majority_service', ], ) diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript index ba5d18a0402..771a567dc7b 100644 --- a/src/mongo/s/SConscript +++ b/src/mongo/s/SConscript @@ -260,6 +260,7 @@ env.Library( '$BUILD_DIR/mongo/db/logical_time_metadata_hook', '$BUILD_DIR/mongo/util/concurrency/thread_pool', '$BUILD_DIR/mongo/executor/task_executor_pool', + '$BUILD_DIR/mongo/util/caching', 'client/shard_interface', 'query/cluster_cursor_manager', 'sharding_routing_table', diff --git a/src/mongo/s/mongos_main.cpp b/src/mongo/s/mongos_main.cpp index a25418bd54d..9477303e6c9 100644 --- a/src/mongo/s/mongos_main.cpp +++ b/src/mongo/s/mongos_main.cpp @@ -670,8 +670,10 @@ ExitCode runMongosServer(ServiceContext* serviceContext) { serviceContext->setPeriodicRunner(std::move(runner)); } +#ifdef MONGO_CONFIG_SSL OCSPManager::get()->startThreadPool(); CertificateExpirationMonitor::get()->start(serviceContext); +#endif serviceContext->setServiceEntryPoint(std::make_unique<ServiceEntryPointMongos>(serviceContext)); diff --git a/src/mongo/shell/mongo_main.cpp b/src/mongo/shell/mongo_main.cpp index b83716e4776..e2651c86dc2 100644 --- a/src/mongo/shell/mongo_main.cpp +++ b/src/mongo/shell/mongo_main.cpp @@ -736,7 +736,9 @@ int mongo_main(int argc, char* argv[]) { // TODO This should use a TransportLayerManager or TransportLayerFactory auto serviceContext = getGlobalServiceContext(); +#ifdef MONGO_CONFIG_SSL OCSPManager::get()->startThreadPool(); +#endif transport::TransportLayerASIO::Options opts; opts.enableIPv6 = shellGlobalParams.enableIPv6; |