diff options
author | Andreas Nilsson <andreas.nilsson@mongodb.com> | 2016-05-16 17:31:59 -0400 |
---|---|---|
committer | Andreas Nilsson <andreas.nilsson@mongodb.com> | 2016-05-16 17:32:42 -0400 |
commit | 41cccb96a3ceb87f8979e9d2730a88fd635bf069 (patch) | |
tree | 1a6887e4654f521eb88c0b8ee031cbf052267136 /src/mongo/db/startup_warnings_common.cpp | |
parent | dca92896c83b519d7754df70f2a6b896804fb859 (diff) | |
download | mongo-41cccb96a3ceb87f8979e9d2730a88fd635bf069.tar.gz |
SERVER-23938 Emit startup warning if running without access control
Diffstat (limited to 'src/mongo/db/startup_warnings_common.cpp')
-rw-r--r-- | src/mongo/db/startup_warnings_common.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/src/mongo/db/startup_warnings_common.cpp b/src/mongo/db/startup_warnings_common.cpp index d4a7944ee66..f5e3706357d 100644 --- a/src/mongo/db/startup_warnings_common.cpp +++ b/src/mongo/db/startup_warnings_common.cpp @@ -74,31 +74,14 @@ void logCommonStartupWarnings(const ServerGlobalParams& serverParams) { warned = true; } - // SERVER-23838 Disable warnings for no access control enabled and no bind_ip - // if (serverParams.authState == ServerGlobalParams::AuthState::kUndefined) { - // log() << startupWarningsLog; - // if (serverParams.bind_ip.empty()) { - // log() << "** WARNING: Insecure configuration, access control is not " - // "enabled and no --bind_ip has been specified." << startupWarningsLog; - // log() << "** Read and write access to data and configuration is " - // "unrestricted, " << startupWarningsLog; - // log() << "** and the server listens on all available network interfaces." - // << startupWarningsLog; - // } else { - // log() << "** WARNING: Access control is not enabled for the database." - // << startupWarningsLog; - // log() << "** Read and write access to data and configuration is " - // "unrestricted." << startupWarningsLog; - // } - // warned = true; - // } else if (serverParams.bind_ip.empty()) { - // log() << startupWarningsLog; - // log() << "** WARNING: The server was started without specifying a " - // "--bind_ip " << startupWarningsLog; - // log() << "** and listens for connections on all available " - // "network interfaces." << startupWarningsLog; - // warned = true; - // } + if (serverParams.authState == ServerGlobalParams::AuthState::kUndefined) { + log() << startupWarningsLog; + log() << "** WARNING: Access control is not enabled for the database." + << startupWarningsLog; + log() << "** Read and write access to data and configuration is " + "unrestricted." << startupWarningsLog; + warned = true; + } const bool is32bit = sizeof(int*) == 4; if (is32bit) { |