Kernel: Implement supplementary groups

This code has very ugly file parsing code. I have to create API
for reading files line by line in kernel space...

This allows users to open framebuffer/input files without root.

Mounting has to be moved to userspace soon. It makes no sense to
hard code permissions for every (device) file.
This commit is contained in:
2024-01-02 23:19:58 +02:00
parent 96d831c31a
commit 9fa13079f2
8 changed files with 188 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <BAN/Vector.h>
#include <sys/types.h>
namespace Kernel
@@ -31,9 +33,17 @@ namespace Kernel
bool is_superuser() const { return m_euid == 0; }
bool has_egid(gid_t) const;
BAN::ErrorOr<void> initialize_supplementary_groups();
private:
BAN::ErrorOr<BAN::String> find_username() const;
private:
uid_t m_ruid, m_euid, m_suid;
gid_t m_rgid, m_egid, m_sgid;
BAN::Vector<gid_t> m_supplementary;
};
}