From 5b6d2644bcc5540ce15442e68b1b6f4d53f83b79 Mon Sep 17 00:00:00 2001 From: brapru Date: Sun, 13 Jun 2021 07:18:17 -0400 Subject: [PATCH] LibCore: Generate new passwd file by checking pw_name LibCore::Account::generate_passwd_file should follow generate_shadow_file by conditionally checking for the username. Previously, usermod's set_uid changes would not reflect in the updated passwd file as m_uid had already been changed to the updated value. --- Userland/Libraries/LibCore/Account.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index 451add1c8a..ef23fa40fa 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -232,7 +232,7 @@ String Account::generate_passwd_file() const struct passwd* p; errno = 0; while ((p = getpwent())) { - if (p->pw_uid == m_uid) { + if (p->pw_name == m_username) { builder.appendff("{}:!:{}:{}:{}:{}:{}\n", m_username, m_uid, m_gid,