mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
Kernel: Allow setgroups() to drop all groups with nullptr
Previously we'd EFAULT for setgroups(0, nullptr), but we can just as well tolerate it if someone wants to drop groups without a pointer.
This commit is contained in:
@@ -2270,7 +2270,7 @@ int Process::sys$setgroups(ssize_t count, const gid_t* gids)
|
||||
return -EINVAL;
|
||||
if (!is_superuser())
|
||||
return -EPERM;
|
||||
if (!validate_read(gids, count))
|
||||
if (count && !validate_read(gids, count))
|
||||
return -EFAULT;
|
||||
m_extra_gids.clear();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user