summaryrefslogtreecommitdiff
path: root/db/commands/isself.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'db/commands/isself.cpp')
-rw-r--r--db/commands/isself.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/db/commands/isself.cpp b/db/commands/isself.cpp
index 5a868de..7b1cea4 100644
--- a/db/commands/isself.cpp
+++ b/db/commands/isself.cpp
@@ -4,6 +4,7 @@
#include "../../util/net/listen.h"
#include "../commands.h"
#include "../../client/dbclient.h"
+#include "../security.h"
#ifndef _WIN32
# ifndef __sunos__
@@ -211,6 +212,11 @@ namespace mongo {
return false;
}
+ if (!noauth && cmdLine.keyFile &&
+ !conn.auth("local", internalSecurity.user, internalSecurity.pwd, errmsg, false)) {
+ return false;
+ }
+
BSONObj out;
bool ok = conn.simpleCommand( "admin" , &out , "_isSelf" );