1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:17:35 +00:00

Refactor: Replace usages of FixedArray with Vector.

This commit is contained in:
asynts 2020-09-07 11:53:54 +02:00 committed by Andreas Kling
parent 9c83d6ff46
commit ec1080b18a
9 changed files with 27 additions and 23 deletions

View file

@ -26,7 +26,7 @@
#pragma once
#include <AK/FixedArray.h>
#include <AK/Span.h>
#include <Kernel/FileSystem/InodeIdentifier.h>
#include <Kernel/KResult.h>
#include <Kernel/UnixTypes.h>
@ -58,35 +58,35 @@ struct InodeMetadata {
bool may_write(const Process&) const;
bool may_execute(const Process&) const;
bool may_read(uid_t u, gid_t g, const FixedArray<gid_t>& eg) const
bool may_read(uid_t u, gid_t g, Span<const gid_t> eg) const
{
if (u == 0)
return true;
if (uid == u)
return mode & S_IRUSR;
if (gid == g || eg.contains(gid))
if (gid == g || eg.contains_slow(gid))
return mode & S_IRGRP;
return mode & S_IROTH;
}
bool may_write(uid_t u, gid_t g, const FixedArray<gid_t>& eg) const
bool may_write(uid_t u, gid_t g, Span<const gid_t> eg) const
{
if (u == 0)
return true;
if (uid == u)
return mode & S_IWUSR;
if (gid == g || eg.contains(gid))
if (gid == g || eg.contains_slow(gid))
return mode & S_IWGRP;
return mode & S_IWOTH;
}
bool may_execute(uid_t u, gid_t g, const FixedArray<gid_t>& eg) const
bool may_execute(uid_t u, gid_t g, Span<const gid_t> eg) const
{
if (u == 0)
return true;
if (uid == u)
return mode & S_IXUSR;
if (gid == g || eg.contains(gid))
if (gid == g || eg.contains_slow(gid))
return mode & S_IXGRP;
return mode & S_IXOTH;
}