mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
c3351d4b9f
Instead of getting credentials from Process::current(), we now require that they be provided as input to the various VFS functions. This ensures that an atomic set of credentials is used throughout an entire VFS operation.
27 lines
693 B
C++
27 lines
693 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/FileSystem/InodeMetadata.h>
|
|
#include <Kernel/Process.h>
|
|
|
|
namespace Kernel {
|
|
|
|
bool InodeMetadata::may_read(Credentials const& credentials) const
|
|
{
|
|
return may_read(credentials.euid(), credentials.egid(), credentials.extra_gids());
|
|
}
|
|
|
|
bool InodeMetadata::may_write(Credentials const& credentials) const
|
|
{
|
|
return may_write(credentials.euid(), credentials.egid(), credentials.extra_gids());
|
|
}
|
|
|
|
bool InodeMetadata::may_execute(Credentials const& credentials) const
|
|
{
|
|
return may_execute(credentials.euid(), credentials.egid(), credentials.extra_gids());
|
|
}
|
|
|
|
}
|