mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 20:32:56 +03:00
LibCore: Call setgrent before looping on groups in get_extra_gids
This commit is contained in:
parent
aee735889e
commit
56010379f9
Notes:
sideshowbarker
2024-07-18 18:41:51 +09:00
Author: https://github.com/setepenre Commit: https://github.com/SerenityOS/serenity/commit/56010379f93 Pull-request: https://github.com/SerenityOS/serenity/pull/6734 Reviewed-by: https://github.com/bcoles Reviewed-by: https://github.com/linusg
@ -43,6 +43,7 @@ static Vector<gid_t> get_extra_gids(const passwd& pwd)
|
||||
{
|
||||
StringView username { pwd.pw_name };
|
||||
Vector<gid_t> extra_gids;
|
||||
setgrent();
|
||||
for (auto* group = getgrent(); group; group = getgrent()) {
|
||||
if (group->gr_gid == pwd.pw_gid)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user