mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
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.
This commit is contained in:
parent
9b5a1b5036
commit
5b6d2644bc
Notes:
sideshowbarker
2024-07-18 09:06:00 +09:00
Author: https://github.com/brapru Commit: https://github.com/SerenityOS/serenity/commit/5b6d2644bcc Pull-request: https://github.com/SerenityOS/serenity/pull/8013 Reviewed-by: https://github.com/linusg
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user