Skip to content

Commit

Permalink
LibCore: Call setgrent before looping on groups in get_extra_gids
Browse files Browse the repository at this point in the history
  • Loading branch information
setepenre authored and linusg committed May 5, 2021
1 parent aee7358 commit 5601037
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Userland/Libraries/LibCore/Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5601037

Please sign in to comment.