summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/killcursors_common.h
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2017-11-02 09:53:31 -0400
committerSara Golemon <sara.golemon@mongodb.com>2017-11-30 14:43:49 -0500
commitd75b113186e1914a5f2dc6d1983d604324a8f7f1 (patch)
tree70456067423a5cae9387beab80a149d29728745b /src/mongo/db/commands/killcursors_common.h
parent3607059cd791b273ccaefd879d765dcd9365ebd6 (diff)
downloadmongo-d75b113186e1914a5f2dc6d1983d604324a8f7f1.tar.gz
SERVER-28260 Check coauth for killCursors and add killAnyCursors
Diffstat (limited to 'src/mongo/db/commands/killcursors_common.h')
-rw-r--r--src/mongo/db/commands/killcursors_common.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/commands/killcursors_common.h b/src/mongo/db/commands/killcursors_common.h
index 43a0443ff80..e34bd5098da 100644
--- a/src/mongo/db/commands/killcursors_common.h
+++ b/src/mongo/db/commands/killcursors_common.h
@@ -26,8 +26,6 @@
* it in the license file.
*/
-#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kQuery
-
#include "mongo/db/commands.h"
#include "mongo/db/cursor_id.h"
@@ -78,6 +76,13 @@ public:
private:
/**
+ * Verify the cursor exists, is unpinned, and can be killed by the current user(s).
+ */
+ virtual Status _checkAuth(Client* client,
+ const NamespaceString& nss,
+ CursorId cursorId) const = 0;
+
+ /**
* Kill the cursor with id 'cursorId' in namespace 'nss'. Use 'opCtx' if necessary.
*
* Returns Status::OK() if the cursor was killed, or ErrorCodes::CursorNotFound if there is no
@@ -85,7 +90,7 @@ private:
*/
virtual Status _killCursor(OperationContext* opCtx,
const NamespaceString& nss,
- CursorId cursorId) = 0;
+ CursorId cursorId) const = 0;
};
} // namespace mongo