From 90ef6be53591ad784d75b6313f0eb879871fb0f4 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Thu, 5 Mar 2020 15:54:52 +0100 Subject: [PATCH] FileManager: Fix group names in the file properties dialog --- Applications/FileManager/PropertiesDialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index 8101c525392..b6acacf6b6e 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -95,8 +96,8 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo } struct passwd* user_pw = getpwuid(st.st_uid); - struct passwd* group_pw = getpwuid(st.st_gid); - ASSERT(user_pw && group_pw); + struct group* group_gr = getgrgid(st.st_gid); + ASSERT(user_pw && group_gr); m_mode = st.st_mode; @@ -116,7 +117,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo properties.append({ "Size:", String::format("%zu bytes", st.st_size) }); properties.append({ "Owner:", String::format("%s (%lu)", user_pw->pw_name, static_cast(user_pw->pw_uid)) }); - properties.append({ "Group:", String::format("%s (%lu)", group_pw->pw_name, static_cast(group_pw->pw_uid)) }); + properties.append({ "Group:", String::format("%s (%lu)", group_gr->gr_name, static_cast(group_gr->gr_gid)) }); properties.append({ "Created at:", GUI::FileSystemModel::timestamp_string(st.st_ctime) }); properties.append({ "Last modified:", GUI::FileSystemModel::timestamp_string(st.st_mtime) });