mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Add chown() syscall and a simple /bin/chown program.
This commit is contained in:
@@ -72,6 +72,11 @@ Vector<Process*> Process::all_processes()
|
||||
return processes;
|
||||
}
|
||||
|
||||
bool Process::in_group(gid_t gid) const
|
||||
{
|
||||
return m_gids.contains(gid);
|
||||
}
|
||||
|
||||
Region* Process::allocate_region(LinearAddress laddr, size_t size, String&& name, bool is_readable, bool is_writable, bool commit)
|
||||
{
|
||||
size = PAGE_ROUND_UP(size);
|
||||
@@ -2157,6 +2162,13 @@ int Process::sys$chmod(const char* pathname, mode_t mode)
|
||||
return VFS::the().chmod(String(pathname), mode, cwd_inode());
|
||||
}
|
||||
|
||||
int Process::sys$chown(const char* pathname, uid_t uid, gid_t gid)
|
||||
{
|
||||
if (!validate_read_str(pathname))
|
||||
return -EFAULT;
|
||||
return VFS::the().chown(String(pathname), uid, gid, cwd_inode());
|
||||
}
|
||||
|
||||
void Process::finalize()
|
||||
{
|
||||
ASSERT(current == g_finalizer);
|
||||
|
||||
Reference in New Issue
Block a user