diff options
Diffstat (limited to 'src/mongo/s')
29 files changed, 70 insertions, 76 deletions
diff --git a/src/mongo/s/cluster_last_error_info.cpp b/src/mongo/s/cluster_last_error_info.cpp index 6ff23456c6c..b474574f35b 100644 --- a/src/mongo/s/cluster_last_error_info.cpp +++ b/src/mongo/s/cluster_last_error_info.cpp @@ -34,8 +34,8 @@ namespace mongo { -const ClientBasic::Decoration<ClusterLastErrorInfo> ClusterLastErrorInfo::get = - ClientBasic::declareDecoration<ClusterLastErrorInfo>(); +const Client::Decoration<ClusterLastErrorInfo> ClusterLastErrorInfo::get = + Client::declareDecoration<ClusterLastErrorInfo>(); void ClusterLastErrorInfo::addShardHost(const std::string& shardHost) { _cur->shardHostsWritten.insert(shardHost); diff --git a/src/mongo/s/cluster_last_error_info.h b/src/mongo/s/cluster_last_error_info.h index 0fc317c660b..648ae12b8b5 100644 --- a/src/mongo/s/cluster_last_error_info.h +++ b/src/mongo/s/cluster_last_error_info.h @@ -29,7 +29,7 @@ #include <set> -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/s/write_ops/batch_write_exec.h" namespace mongo { @@ -40,7 +40,7 @@ namespace mongo { */ class ClusterLastErrorInfo { public: - static const ClientBasic::Decoration<ClusterLastErrorInfo> get; + static const Client::Decoration<ClusterLastErrorInfo> get; /** new request not associated (yet or ever) with a client */ void newRequest(); diff --git a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp index 381328fcd91..36d504c276d 100644 --- a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp @@ -85,7 +85,7 @@ public: help << "adds a shard to zone"; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) override { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp index 50fbf6ba6eb..d7a1337aed0 100644 --- a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp +++ b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp @@ -66,7 +66,7 @@ public: help << "Starts or stops the sharding balancer."; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) override { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_current_op.cpp b/src/mongo/s/commands/cluster_current_op.cpp index dd200b08dd8..c9a307c4c39 100644 --- a/src/mongo/s/commands/cluster_current_op.cpp +++ b/src/mongo/s/commands/cluster_current_op.cpp @@ -62,7 +62,7 @@ public: return true; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) final { bool isAuthorized = AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp index ff11011a59d..e6352a95fa1 100644 --- a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp +++ b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp @@ -37,7 +37,7 @@ #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/authorization_session.h" -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/s/catalog/catalog_cache.h" #include "mongo/s/catalog/sharding_catalog_client.h" @@ -71,7 +71,7 @@ public: << " { enablesharding : \"<dbname>\" }\n"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( @@ -107,7 +107,7 @@ public: Status status = grid.catalogClient(txn)->enableSharding(txn, dbname); if (status.isOK()) { - audit::logEnableSharding(ClientBasic::getCurrent(), dbname); + audit::logEnableSharding(Client::getCurrent(), dbname); } // Make sure to force update of any stale metadata diff --git a/src/mongo/s/commands/cluster_explain_cmd.cpp b/src/mongo/s/commands/cluster_explain_cmd.cpp index eddac77e971..0218e257b36 100644 --- a/src/mongo/s/commands/cluster_explain_cmd.cpp +++ b/src/mongo/s/commands/cluster_explain_cmd.cpp @@ -87,7 +87,7 @@ public: * the command that you are explaining. The auth check is performed recursively * on the nested command. */ - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (Object != cmdObj.firstElement().type()) { diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp index 9a742c979e6..b9488073a2f 100644 --- a/src/mongo/s/commands/cluster_find_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_cmd.cpp @@ -92,7 +92,7 @@ public: * In order to run the find command, you must be authorized for the "find" action * type on the collection. */ - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) final { NamespaceString nss(parseNs(dbname, cmdObj)); diff --git a/src/mongo/s/commands/cluster_ftdc_commands.cpp b/src/mongo/s/commands/cluster_ftdc_commands.cpp index bfe339198c4..23903e92984 100644 --- a/src/mongo/s/commands/cluster_ftdc_commands.cpp +++ b/src/mongo/s/commands/cluster_ftdc_commands.cpp @@ -64,7 +64,7 @@ public: return false; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) override { return Status::OK(); diff --git a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp index 5cb36e28f93..eb603d27cb3 100644 --- a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp @@ -66,7 +66,7 @@ public: help << " example: { getShardVersion : 'alleyinsider.foo' } "; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_getmore_cmd.cpp b/src/mongo/s/commands/cluster_getmore_cmd.cpp index 270100a2b47..dff5c9c7e4a 100644 --- a/src/mongo/s/commands/cluster_getmore_cmd.cpp +++ b/src/mongo/s/commands/cluster_getmore_cmd.cpp @@ -78,7 +78,7 @@ public: help << "retrieve more documents for a cursor id"; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) final { StatusWith<GetMoreRequest> parseStatus = GetMoreRequest::parseFromBSON(dbname, cmdObj); diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp index bbd7de10711..3a0824cddbf 100644 --- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp +++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp @@ -78,9 +78,7 @@ public: ss << _helpText; } - Status checkAuthForCommand(ClientBasic* client, - const std::string& dbname, - const BSONObj& cmdObj) { + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { AuthorizationSession* authzSession = AuthorizationSession::get(client); ResourcePattern pattern = parseResourcePattern(dbname, cmdObj); diff --git a/src/mongo/s/commands/cluster_kill_op.cpp b/src/mongo/s/commands/cluster_kill_op.cpp index caa46351279..ba698426fcc 100644 --- a/src/mongo/s/commands/cluster_kill_op.cpp +++ b/src/mongo/s/commands/cluster_kill_op.cpp @@ -68,7 +68,7 @@ public: return true; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) final { bool isAuthorized = AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp index c935feedc3a..d534c29aadd 100644 --- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp +++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp @@ -64,7 +64,7 @@ public: << "usage: { mergeChunks : <ns>, bounds : [ <min key>, <max key> ] }"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index 0afc654b245..282667dd6eb 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -35,7 +35,7 @@ #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/authorization_session.h" -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/write_concern_options.h" #include "mongo/s/balancer/balancer_configuration.h" @@ -82,7 +82,7 @@ public: << " , to : 'shard001' }\n"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_move_primary_cmd.cpp b/src/mongo/s/commands/cluster_move_primary_cmd.cpp index 028a15179fe..5db4f4aa666 100644 --- a/src/mongo/s/commands/cluster_move_primary_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_primary_cmd.cpp @@ -39,7 +39,7 @@ #include "mongo/db/auth/authorization_session.h" #include "mongo/db/catalog/document_validation.h" #include "mongo/db/client.h" -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/operation_context.h" #include "mongo/rpc/get_status_from_command_result.h" @@ -81,7 +81,7 @@ public: help << " example: { moveprimary : 'foo' , to : 'localhost:9999' }"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_pipeline_cmd.cpp b/src/mongo/s/commands/cluster_pipeline_cmd.cpp index 2a34bd623ad..919fd3116f5 100644 --- a/src/mongo/s/commands/cluster_pipeline_cmd.cpp +++ b/src/mongo/s/commands/cluster_pipeline_cmd.cpp @@ -96,7 +96,7 @@ public: } // virtuals from Command - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) final { return Pipeline::checkAuthForCommand(client, dbname, cmdObj); diff --git a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp index 65c3035d993..bb053e15f26 100644 --- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp +++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp @@ -29,7 +29,7 @@ #include "mongo/base/error_codes.h" #include "mongo/base/init.h" #include "mongo/db/auth/authorization_session.h" -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/query/collation/collation_spec.h" #include "mongo/s/commands/strategy.h" @@ -74,9 +74,7 @@ public: return parseNsCollectionRequired(dbname, cmdObj).ns(); } - Status checkAuthForCommand(ClientBasic* client, - const std::string& dbname, - const BSONObj& cmdObj) { + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { AuthorizationSession* authzSession = AuthorizationSession::get(client); ResourcePattern pattern = parseResourcePattern(dbname, cmdObj); diff --git a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp index 40dda76c987..a24c7a63e3b 100644 --- a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp +++ b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp @@ -85,7 +85,7 @@ public: help << "removes a shard from the zone"; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) override { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp index f019370818f..5c342b14489 100644 --- a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp +++ b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp @@ -57,7 +57,7 @@ public: help << "Not supported through mongos"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { // Require no auth since this command isn't supported in mongos diff --git a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp index 6ce23736609..25d74323b5c 100644 --- a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp @@ -41,7 +41,7 @@ #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/authorization_session.h" -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/hasher.h" #include "mongo/db/operation_context.h" @@ -92,7 +92,7 @@ public: << " { enablesharding : \"<dbname>\" }\n"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( @@ -475,8 +475,7 @@ public: LOG(0) << "CMD: shardcollection: " << cmdObj; - audit::logShardCollection( - ClientBasic::getCurrent(), nss.ns(), proposedKey, careAboutUnique); + audit::logShardCollection(Client::getCurrent(), nss.ns(), proposedKey, careAboutUnique); Status status = grid.catalogClient(txn)->shardCollection(txn, nss.ns(), diff --git a/src/mongo/s/commands/cluster_split_cmd.cpp b/src/mongo/s/commands/cluster_split_cmd.cpp index ebae1fd1e07..719ea3b5aaf 100644 --- a/src/mongo/s/commands/cluster_split_cmd.cpp +++ b/src/mongo/s/commands/cluster_split_cmd.cpp @@ -81,7 +81,7 @@ public: << " NOTE: this does not move the chunks, it just creates a logical separation."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp index c50d92f576d..a08e0d32677 100644 --- a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp +++ b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp @@ -88,7 +88,7 @@ public: help << "assigns/remove a range of a sharded collection to a zone"; } - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) override { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( diff --git a/src/mongo/s/commands/cluster_user_management_commands.cpp b/src/mongo/s/commands/cluster_user_management_commands.cpp index 93e344c766c..1a200ce6c9c 100644 --- a/src/mongo/s/commands/cluster_user_management_commands.cpp +++ b/src/mongo/s/commands/cluster_user_management_commands.cpp @@ -73,7 +73,7 @@ public: ss << "Adds a user to the system"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForCreateUserCommand(client, dbname, cmdObj); @@ -112,7 +112,7 @@ public: ss << "Used to update a user, for example to change its password"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForUpdateUserCommand(client, dbname, cmdObj); @@ -162,7 +162,7 @@ public: ss << "Drops a single user."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForDropUserCommand(client, dbname, cmdObj); @@ -208,7 +208,7 @@ public: ss << "Drops all users for a single database."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForDropAllUsersFromDatabaseCommand(client, dbname); @@ -249,7 +249,7 @@ public: ss << "Grants roles to a user."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForGrantRolesToUserCommand(client, dbname, cmdObj); @@ -297,7 +297,7 @@ public: ss << "Revokes roles from a user."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForRevokeRolesFromUserCommand(client, dbname, cmdObj); @@ -349,7 +349,7 @@ public: ss << "Returns information about users."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForUsersInfoCommand(client, dbname, cmdObj); @@ -383,7 +383,7 @@ public: ss << "Adds a role to the system"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForCreateRoleCommand(client, dbname, cmdObj); @@ -418,7 +418,7 @@ public: ss << "Used to update a role"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForUpdateRoleCommand(client, dbname, cmdObj); @@ -459,7 +459,7 @@ public: ss << "Grants privileges to a role"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForGrantPrivilegesToRoleCommand(client, dbname, cmdObj); @@ -500,7 +500,7 @@ public: ss << "Revokes privileges from a role"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForRevokePrivilegesFromRoleCommand(client, dbname, cmdObj); @@ -541,7 +541,7 @@ public: ss << "Grants roles to another role."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForGrantRolesToRoleCommand(client, dbname, cmdObj); @@ -582,7 +582,7 @@ public: ss << "Revokes roles from another role."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForRevokeRolesFromRoleCommand(client, dbname, cmdObj); @@ -626,7 +626,7 @@ public: "removed from some user/roles but otherwise still exists."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForDropRoleCommand(client, dbname, cmdObj); @@ -671,7 +671,7 @@ public: "exist."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForDropAllRolesFromDatabaseCommand(client, dbname); @@ -716,7 +716,7 @@ public: ss << "Returns information about roles."; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForRolesInfoCommand(client, dbname, cmdObj); @@ -754,7 +754,7 @@ public: ss << "Invalidates the in-memory cache of user information"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForInvalidateUserCacheCommand(client); @@ -805,7 +805,7 @@ public: ss << "Internal command used by mongorestore for updating user/role data"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForMergeAuthzCollectionsCommand(client, cmdObj); @@ -903,7 +903,7 @@ public: ss << "Upgrades the auth data storage schema"; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return auth::checkAuthForAuthSchemaUpgradeCommand(client); diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp index 19a9969de6c..317019abb01 100644 --- a/src/mongo/s/commands/cluster_write_cmd.cpp +++ b/src/mongo/s/commands/cluster_write_cmd.cpp @@ -32,7 +32,7 @@ #include "mongo/base/owned_pointer_vector.h" #include "mongo/client/remote_command_targeter.h" #include "mongo/db/client.h" -#include "mongo/db/client_basic.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/commands/write_commands/write_commands_common.h" #include "mongo/db/lasterror.h" @@ -78,7 +78,7 @@ public: return true; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { Status status = auth::checkAuthForWriteCommand(AuthorizationSession::get(client), diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index ef395f11d35..3b2fc9630ad 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -501,7 +501,7 @@ public: class CreateCmd : public PublicGridCommand { public: CreateCmd() : PublicGridCommand("create") {} - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { AuthorizationSession* authzSession = AuthorizationSession::get(client); @@ -594,7 +594,7 @@ public: class RenameCollectionCmd : public PublicGridCommand { public: RenameCollectionCmd() : PublicGridCommand("renameCollection") {} - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return rename_collection::checkAuthForRenameCollectionCommand(client, dbname, cmdObj); @@ -639,7 +639,7 @@ public: virtual bool adminOnly() const { return true; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return copydb::checkAuthForCopydbCommand(client, dbname, cmdObj); @@ -1081,7 +1081,7 @@ public: virtual bool supportsWriteConcern(const BSONObj& cmd) const override { return false; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { if (!AuthorizationSession::get(client)->isAuthorizedForActionsOnResource( @@ -1694,7 +1694,7 @@ class CmdListCollections final : public PublicGridCommand { public: CmdListCollections() : PublicGridCommand("listCollections") {} - Status checkAuthForCommand(ClientBasic* client, + Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) final { AuthorizationSession* authzSession = AuthorizationSession::get(client); @@ -1735,7 +1735,7 @@ public: class CmdListIndexes final : public PublicGridCommand { public: CmdListIndexes() : PublicGridCommand("listIndexes") {} - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { AuthorizationSession* authzSession = AuthorizationSession::get(client); @@ -1783,7 +1783,7 @@ public: virtual bool slaveOk() const { return true; } - virtual Status checkAuthForCommand(ClientBasic* client, + virtual Status checkAuthForCommand(Client* client, const std::string& dbname, const BSONObj& cmdObj) { return Status::OK(); diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp index dbd551c908e..6deb049d7ad 100644 --- a/src/mongo/s/commands/strategy.cpp +++ b/src/mongo/s/commands/strategy.cpp @@ -108,7 +108,7 @@ void runAgainstRegistered(OperationContext* txn, return; } - Command::execCommandClientBasic(txn, c, queryOptions, ns, jsobj, anObjBuilder); + Command::execCommandClient(txn, c, queryOptions, ns, jsobj, anObjBuilder); } /** @@ -159,7 +159,7 @@ void Strategy::queryOp(OperationContext* txn, Request& request) { QueryMessage q(request.d()); NamespaceString ns(q.ns); - ClientBasic* client = txn->getClient(); + Client* client = txn->getClient(); AuthorizationSession* authSession = AuthorizationSession::get(client); Status status = authSession->checkAuthForFind(ns, false); audit::logQueryAuthzCheck(client, ns, q.query, status.code()); diff --git a/src/mongo/s/s_only.cpp b/src/mongo/s/s_only.cpp index d29eb7de7a4..18db1dd374e 100644 --- a/src/mongo/s/s_only.cpp +++ b/src/mongo/s/s_only.cpp @@ -82,18 +82,17 @@ void Command::execCommand(OperationContext* txn, std::string db = request.getDatabase().rawData(); BSONObjBuilder result; - execCommandClientBasic( - txn, command, queryFlags, request.getDatabase().rawData(), cmdObj, result); + execCommandClient(txn, command, queryFlags, request.getDatabase().rawData(), cmdObj, result); replyBuilder->setCommandReply(result.done()).setMetadata(rpc::makeEmptyMetadata()); } -void Command::execCommandClientBasic(OperationContext* txn, - Command* c, - int queryOptions, - const char* ns, - BSONObj& cmdObj, - BSONObjBuilder& result) { +void Command::execCommandClient(OperationContext* txn, + Command* c, + int queryOptions, + const char* ns, + BSONObj& cmdObj, + BSONObjBuilder& result) { std::string dbname = nsToDatabase(ns); if (cmdObj.getBoolField("help")) { diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index 155deb809c5..809164b6e04 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -147,7 +147,7 @@ static void cleanupTask() { grid.catalogClient(txn)->shutDown(txn); } - audit::logShutdown(ClientBasic::getCurrent()); + audit::logShutdown(Client::getCurrent()); } static BSONObj buildErrReply(const DBException& ex) { |