From 56010379f93fe999fa25a6cbb8c3922727d85a23 Mon Sep 17 00:00:00 2001 From: setepenre Date: Wed, 5 May 2021 13:22:50 +0200 Subject: [PATCH] LibCore: Call setgrent before looping on groups in get_extra_gids --- Userland/Libraries/LibCore/Account.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index 7ed8f3b045..a0e72f2de4 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -43,6 +43,7 @@ static Vector get_extra_gids(const passwd& pwd) { StringView username { pwd.pw_name }; Vector extra_gids; + setgrent(); for (auto* group = getgrent(); group; group = getgrent()) { if (group->gr_gid == pwd.pw_gid) continue;