mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
Merge PR #37190 into master
* refs/pull/37190/head: mon/MonCap: check profile_grants too while checking caps Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
commit
22b3d48fa0
@ -195,13 +195,22 @@ struct MonCap {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool fs_name_capable(string_view fs_name, __u8 mask) {
|
||||
for (auto& g: grants) {
|
||||
bool fs_name_capable(const EntityName& ename, string_view fs_name,
|
||||
__u8 mask) {
|
||||
for (auto& g : grants) {
|
||||
if (g.is_allow_all()) {
|
||||
return true;
|
||||
}
|
||||
if (g.fs_name.empty() || g.fs_name == fs_name) {
|
||||
if (mask & g.allow) {
|
||||
|
||||
if ((g.fs_name.empty() || g.fs_name == fs_name) && (mask & g.allow)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
g.expand_profile(ename);
|
||||
for (auto& pg : g.profile_grants) {
|
||||
if ((pg.service == "fs" || pg.service == "mds") &&
|
||||
(pg.fs_name.empty() || pg.fs_name == fs_name) &&
|
||||
(pg.allow & mask)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ struct MonSession : public RefCountedObject {
|
||||
}
|
||||
|
||||
bool fs_name_capable(string_view fsname, __u8 mask) {
|
||||
return caps.fs_name_capable(fsname, mask);
|
||||
return caps.fs_name_capable(entity_name, fsname, mask);
|
||||
}
|
||||
|
||||
const entity_addr_t& get_peer_socket_addr() {
|
||||
|
Loading…
Reference in New Issue
Block a user