summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/security_key.cpp
diff options
context:
space:
mode:
authorAndreas Nilsson <andreas.nilsson@10gen.com>2013-07-03 17:09:09 +0100
committerAndreas Nilsson <andreas.nilsson@10gen.com>2013-07-03 18:29:37 +0100
commit00fb45cd97d2314548dc07c2c8e1cc1737fd273f (patch)
tree39bad422345f565c4bd8c6728eb8eb8a1e6104b1 /src/mongo/db/auth/security_key.cpp
parent3457954bb082d98dfd769d27771d4e30f3f785a5 (diff)
downloadmongo-00fb45cd97d2314548dc07c2c8e1cc1737fd273f.tar.gz
SERVER-7455 Common internal cluster auth function
Diffstat (limited to 'src/mongo/db/auth/security_key.cpp')
-rw-r--r--src/mongo/db/auth/security_key.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mongo/db/auth/security_key.cpp b/src/mongo/db/auth/security_key.cpp
index c5f85bee877..70a152fa289 100644
--- a/src/mongo/db/auth/security_key.cpp
+++ b/src/mongo/db/auth/security_key.cpp
@@ -20,7 +20,6 @@
#include <string>
#include <vector>
-#include "mongo/client/dbclientinterface.h"
#include "mongo/db/auth/action_set.h"
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/authorization_manager.h"
@@ -29,6 +28,24 @@
namespace mongo {
+ AuthInfo::AuthInfo() {
+ user = "__system";
+ }
+ AuthInfo internalSecurity;
+
+ bool authenticateInternalUser(DBClientWithCommands* conn){
+ string err;
+ if( !conn->auth("local",
+ internalSecurity.user,
+ internalSecurity.pwd,
+ err,
+ false) ) {
+ log() << "can't authenticate as internal user, error: " << err << endl;
+ return false;
+ }
+ return true;
+ }
+
bool setUpSecurityKey(const string& filename) {
struct stat stats;