diff options
author | Kristina <kristina@10gen.com> | 2011-09-30 11:25:22 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-10-08 23:32:56 -0400 |
commit | 56b7cf65d1e646625af6cc2b0ff5285b6fbcb322 (patch) | |
tree | 8389e6297930bea0211bfcc0746791596b85b075 | |
parent | 41ff2157a3fa5b0d722043f4db2ec947481897fe (diff) | |
download | mongo-56b7cf65d1e646625af6cc2b0ff5285b6fbcb322.tar.gz |
check auth on _isSelf call SERVER-3953
-rw-r--r-- | db/commands/isself.cpp | 6 |
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" ); |