summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/killcursors_common.h
diff options
context:
space:
mode:
authorSergey Galtsev <sergey.galtsev@mongodb.com>2021-03-05 22:37:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-05 23:14:19 +0000
commitf2060e3a81f74a6fc96ef040eade41d48dcd5c7d (patch)
tree573904406eede1c892501c0863fbd6a018ed645d /src/mongo/db/commands/killcursors_common.h
parent3dcd089735f024a0fffcfdff446215492f9281e6 (diff)
downloadmongo-f2060e3a81f74a6fc96ef040eade41d48dcd5c7d.tar.gz
SERVER-32640 migrate cursor kill audit into authorization check
Diffstat (limited to 'src/mongo/db/commands/killcursors_common.h')
-rw-r--r--src/mongo/db/commands/killcursors_common.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/db/commands/killcursors_common.h b/src/mongo/db/commands/killcursors_common.h
index da9f5cf6e5f..900038fad59 100644
--- a/src/mongo/db/commands/killcursors_common.h
+++ b/src/mongo/db/commands/killcursors_common.h
@@ -92,13 +92,13 @@ public:
const auto& nss = killCursorsRequest.getNamespace();
for (CursorId id : killCursorsRequest.getCursorIds()) {
auto status = Impl::doCheckAuth(opCtx, nss, id);
+ audit::logKillCursorsAuthzCheck(opCtx->getClient(), nss, id, status.code());
if (!status.isOK()) {
if (status.code() == ErrorCodes::CursorNotFound) {
// Not found isn't an authorization issue.
// run() will raise it as a return value.
continue;
}
- audit::logKillCursorsAuthzCheck(opCtx->getClient(), nss, id, status.code());
uassertStatusOK(status); // throws
}
}
@@ -120,9 +120,6 @@ public:
} else {
cursorsAlive.push_back(id);
}
-
- audit::logKillCursorsAuthzCheck(
- opCtx->getClient(), killCursorsRequest.getNamespace(), id, status.code());
}
KillCursorsReply reply;