mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:57:45 +00:00
LibCore: Call setgrent before looping on groups in get_extra_gids
This commit is contained in:
parent
aee735889e
commit
56010379f9
1 changed files with 1 additions and 0 deletions
|
@ -43,6 +43,7 @@ static Vector<gid_t> get_extra_gids(const passwd& pwd)
|
||||||
{
|
{
|
||||||
StringView username { pwd.pw_name };
|
StringView username { pwd.pw_name };
|
||||||
Vector<gid_t> extra_gids;
|
Vector<gid_t> extra_gids;
|
||||||
|
setgrent();
|
||||||
for (auto* group = getgrent(); group; group = getgrent()) {
|
for (auto* group = getgrent(); group; group = getgrent()) {
|
||||||
if (group->gr_gid == pwd.pw_gid)
|
if (group->gr_gid == pwd.pw_gid)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue