summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2011-09-30 11:25:22 -0400
committerEliot Horowitz <eliot@10gen.com>2011-10-08 23:32:56 -0400
commit56b7cf65d1e646625af6cc2b0ff5285b6fbcb322 (patch)
tree8389e6297930bea0211bfcc0746791596b85b075
parent41ff2157a3fa5b0d722043f4db2ec947481897fe (diff)
downloadmongo-56b7cf65d1e646625af6cc2b0ff5285b6fbcb322.tar.gz
check auth on _isSelf call SERVER-3953
-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 5a868de919f..7b1cea4b3d2 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" );