mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +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:
parent
69af59d061
commit
5abc30e057
Notes:
sideshowbarker
2024-07-19 10:22:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5abc30e0577
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue