mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 17:47:18 +00:00
Kernel: Allow passing initial UID and GID when creating new inodes
If we're creating something that should have a different owner than the current process's UID/GID, we need to plumb that all the way through VFS down to the FS functions.
This commit is contained in:
@@ -31,6 +31,11 @@ class Custody;
|
||||
class Device;
|
||||
class FileDescription;
|
||||
|
||||
struct UidAndGid {
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
};
|
||||
|
||||
class VFS {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
@@ -62,8 +67,8 @@ public:
|
||||
KResult mount(NonnullRefPtr<FS>&&, Custody& mount_point);
|
||||
KResult unmount(InodeIdentifier guest_inode_id);
|
||||
|
||||
KResultOr<NonnullRefPtr<FileDescription>> open(StringView path, int options, mode_t mode, Custody& base);
|
||||
KResultOr<NonnullRefPtr<FileDescription>> create(StringView path, int options, mode_t mode, Custody& parent_custody);
|
||||
KResultOr<NonnullRefPtr<FileDescription>> open(StringView path, int options, mode_t mode, Custody& base, Optional<UidAndGid> = {});
|
||||
KResultOr<NonnullRefPtr<FileDescription>> create(StringView path, int options, mode_t mode, Custody& parent_custody, Optional<UidAndGid> = {});
|
||||
KResult mkdir(StringView path, mode_t mode, Custody& base);
|
||||
KResult link(StringView old_path, StringView new_path, Custody& base);
|
||||
KResult unlink(StringView path, Custody& base);
|
||||
|
||||
Reference in New Issue
Block a user