summaryrefslogtreecommitdiff
path: root/db/commands
diff options
context:
space:
mode:
Diffstat (limited to 'db/commands')
-rw-r--r--db/commands/isself.cpp6
-rw-r--r--db/commands/mr.cpp1
2 files changed, 7 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" );
diff --git a/db/commands/mr.cpp b/db/commands/mr.cpp
index 56e9770..b79e62b 100644
--- a/db/commands/mr.cpp
+++ b/db/commands/mr.cpp
@@ -1119,6 +1119,7 @@ namespace mongo {
virtual LockType locktype() const { return NONE; }
bool run(const string& dbname , BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool) {
+ ShardedConnectionInfo::addHook();
string shardedOutputCollection = cmdObj["shardedOutputCollection"].valuestrsafe();
string postProcessCollection = cmdObj["postProcessCollection"].valuestrsafe();
bool postProcessOnly = !(postProcessCollection.empty());