Kernel: Add basic Credentials for the system
Now filesystem access/open, etc confirm that you have access for rwxs
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <BAN/Vector.h>
|
||||
|
||||
#include <kernel/API/DirectoryEntry.h>
|
||||
#include <kernel/Credentials.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
@@ -56,6 +57,8 @@ namespace Kernel
|
||||
public:
|
||||
virtual ~Inode() {}
|
||||
|
||||
bool can_access(const Credentials&, int);
|
||||
|
||||
bool operator==(const Inode& other) const { return dev() == other.dev() && rdev() == other.rdev() && ino() == other.ino(); }
|
||||
|
||||
virtual ino_t ino() const = 0;
|
||||
|
||||
@@ -11,21 +11,21 @@ namespace Kernel
|
||||
class VirtualFileSystem : public FileSystem
|
||||
{
|
||||
public:
|
||||
static BAN::ErrorOr<void> initialize(BAN::StringView);
|
||||
static void initialize(BAN::StringView);
|
||||
static VirtualFileSystem& get();
|
||||
virtual ~VirtualFileSystem() {};
|
||||
|
||||
virtual BAN::RefPtr<Inode> root_inode() override { return m_root_fs->root_inode(); }
|
||||
|
||||
BAN::ErrorOr<void> mount(BAN::StringView, BAN::StringView);
|
||||
BAN::ErrorOr<void> mount(FileSystem*, BAN::StringView);
|
||||
BAN::ErrorOr<void> mount(const Credentials&, BAN::StringView, BAN::StringView);
|
||||
BAN::ErrorOr<void> mount(const Credentials&, FileSystem*, BAN::StringView);
|
||||
|
||||
struct File
|
||||
{
|
||||
BAN::RefPtr<Inode> inode;
|
||||
BAN::String canonical_path;
|
||||
};
|
||||
BAN::ErrorOr<File> file_from_absolute_path(BAN::StringView, bool follow_link);
|
||||
BAN::ErrorOr<File> file_from_absolute_path(const Credentials&, BAN::StringView, int);
|
||||
|
||||
private:
|
||||
VirtualFileSystem() = default;
|
||||
|
||||
Reference in New Issue
Block a user