diff options
author | setepenre <usermaatre.setepenre@protonmail.com> | 2021-05-05 13:22:50 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-05 15:12:30 +0100 |
commit | 56010379f93fe999fa25a6cbb8c3922727d85a23 (patch) | |
tree | 8dded44c94702927cf567c7fc5fdd84d36ad8ae6 /Userland/Libraries/LibCore | |
parent | aee735889eda7243f542e42b441124dc3b4faa26 (diff) | |
download | serenity-56010379f93fe999fa25a6cbb8c3922727d85a23.zip |
LibCore: Call setgrent before looping on groups in get_extra_gids
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r-- | Userland/Libraries/LibCore/Account.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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<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; |