summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbcommands_generic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/dbcommands_generic.cpp')
-rw-r--r--src/mongo/db/dbcommands_generic.cpp60
1 files changed, 49 insertions, 11 deletions
diff --git a/src/mongo/db/dbcommands_generic.cpp b/src/mongo/db/dbcommands_generic.cpp
index 396ccbca7eb..fa640d0fa47 100644
--- a/src/mongo/db/dbcommands_generic.cpp
+++ b/src/mongo/db/dbcommands_generic.cpp
@@ -70,7 +70,6 @@ namespace mongo {
using std::stringstream;
using std::vector;
-
class CmdBuildInfo : public Command {
public:
CmdBuildInfo() : Command( "buildInfo", true, "buildinfo" ) {}
@@ -89,8 +88,7 @@ namespace mongo {
BSONObj& jsobj,
int, // options
std::string& errmsg,
- BSONObjBuilder& result,
- bool fromRepl) {
+ BSONObjBuilder& result) {
appendBuildInfo(result);
return true;
@@ -108,7 +106,12 @@ namespace mongo {
virtual void addRequiredPrivileges(const std::string& dbname,
const BSONObj& cmdObj,
std::vector<Privilege>* out) {} // No auth required
- virtual bool run(OperationContext* txn, const string& badns, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool) {
+ virtual bool run(OperationContext* txn,
+ const string& badns,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
// IMPORTANT: Don't put anything in here that might lock db - including authentication
return true;
}
@@ -123,7 +126,12 @@ namespace mongo {
virtual void addRequiredPrivileges(const std::string& dbname,
const BSONObj& cmdObj,
std::vector<Privilege>* out) {} // No auth required
- virtual bool run(OperationContext* txn, const string& ns, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
+ virtual bool run(OperationContext* txn,
+ const string& ns,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
if ( globalScriptEngine ) {
BSONObjBuilder bb( result.subobjStart( "js" ) );
result.append( "utf8" , globalScriptEngine->utf8Ok() );
@@ -158,7 +166,12 @@ namespace mongo {
actions.addAction(ActionType::hostInfo);
out->push_back(Privilege(ResourcePattern::forClusterResource(), actions));
}
- bool run(OperationContext* txn, const string& dbname, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
+ bool run(OperationContext* txn,
+ const string& dbname,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
ProcessInfo p;
BSONObjBuilder bSys, bOs;
@@ -195,7 +208,12 @@ namespace mongo {
actions.addAction(ActionType::logRotate);
out->push_back(Privilege(ResourcePattern::forClusterResource(), actions));
}
- virtual bool run(OperationContext* txn, const string& ns, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
+ virtual bool run(OperationContext* txn,
+ const string& ns,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
bool didRotate = rotateLogs(serverGlobalParams.logRenameOnRotate);
if (didRotate)
logProcessDetailsForLogRotate();
@@ -214,7 +232,12 @@ namespace mongo {
virtual void addRequiredPrivileges(const std::string& dbname,
const BSONObj& cmdObj,
std::vector<Privilege>* out) {} // No auth required
- virtual bool run(OperationContext* txn, const string& ns, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
+ virtual bool run(OperationContext* txn,
+ const string& ns,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
BSONObjBuilder b( result.subobjStart( "commands" ) );
for ( CommandMap::const_iterator i=_commands->begin(); i!=_commands->end(); ++i ) {
Command * c = i->second;
@@ -305,7 +328,12 @@ namespace mongo {
const BSONObj& cmdObj,
std::vector<Privilege>* out) {} // No auth required
CmdForceError() : Command("forceerror") {}
- bool run(OperationContext* txn, const string& dbnamne, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
+ bool run(OperationContext* txn,
+ const string& dbnamne,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
setLastError(10038, "forced error");
return false;
}
@@ -329,7 +357,12 @@ namespace mongo {
help << "{ getLog : '*' } OR { getLog : 'global' }";
}
- virtual bool run(OperationContext* txn, const string& dbname , BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool) {
+ virtual bool run(OperationContext* txn,
+ const string& dbname,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
BSONElement val = cmdObj.firstElement();
if (val.type() != String) {
return appendCommandStatus(result, Status(ErrorCodes::TypeMismatch, str::stream()
@@ -383,7 +416,12 @@ namespace mongo {
actions.addAction(ActionType::getCmdLineOpts);
out->push_back(Privilege(ResourcePattern::forClusterResource(), actions));
}
- virtual bool run(OperationContext* txn, const string&, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
+ virtual bool run(OperationContext* txn,
+ const string&,
+ BSONObj& cmdObj,
+ int,
+ string& errmsg,
+ BSONObjBuilder& result) {
result.append("argv", serverGlobalParams.argvArray);
result.append("parsed", serverGlobalParams.parsedOpts);
return true;