summaryrefslogtreecommitdiff
path: root/src/mongo/db/instance.cpp
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-04-02 18:37:06 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-04-13 10:14:12 -0400
commit1991daaff1a108d98f6e9e7414a16131e244bdd4 (patch)
tree24051b5af1c645f37d4f3ecea5b5c3d64a75c9ac /src/mongo/db/instance.cpp
parent5cfd95b0eb36c72f1b1b131ff1de76fe05f16cc3 (diff)
downloadmongo-1991daaff1a108d98f6e9e7414a16131e244bdd4.tar.gz
SERVER-7775 add currentOp command
Diffstat (limited to 'src/mongo/db/instance.cpp')
-rw-r--r--src/mongo/db/instance.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 94736779cfe..96748d818e9 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -50,7 +50,6 @@
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
-#include "mongo/db/currentop_command.h"
#include "mongo/db/db.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/dbdirectclient.h"
@@ -391,11 +390,19 @@ namespace {
isCommand = true;
opwrite(m);
}
+ // TODO: remove this entire code path after 3.2. Refs SERVER-7775
else if (nsString.isSpecialCommand()) {
opwrite(m);
if (nsString.coll() == "$cmd.sys.inprog") {
- inProgCmd(txn, nsString, m, dbresponse);
+ // HACK:
+ // legacy inprog could run on any database. The currentOp command
+ // can only run on 'admin'. To avoid breaking old shells and a multitude
+ // of third-party tools, we rewrite the namespace. As auth is checked
+ // later in Command::_checkAuthorizationImpl, we will still properly
+ // reject the request if the client is not authorized.
+ NamespaceString adminKludge("admin", nsString.coll());
+ receivedPseudoCommand(txn, adminKludge, c, dbresponse, m, "currentOp");
return;
}
if (nsString.coll() == "$cmd.sys.killop") {