1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

su+passwd: Don't copy Core::Account unnecessarily

This commit is contained in:
Andreas Kling 2021-01-09 17:54:09 +01:00
parent 2ba9e6c866
commit 9766f61f7b
2 changed files with 2 additions and 2 deletions

View file

@ -108,7 +108,7 @@ int main(int argc, char** argv)
} }
// target_account is the account we are changing the password of. // target_account is the account we are changing the password of.
auto target_account = account_or_error.value(); auto& target_account = account_or_error.value();
if (current_uid != 0 && current_uid != target_account.uid()) { if (current_uid != 0 && current_uid != target_account.uid()) {
fprintf(stderr, "You can't modify passwd for %s\n", username); fprintf(stderr, "You can't modify passwd for %s\n", username);

View file

@ -68,7 +68,7 @@ int main(int argc, char** argv)
return 1; return 1;
} }
Core::Account account = account_or_error.value(); const auto& account = account_or_error.value();
if (getuid() != 0 && account.has_password()) { if (getuid() != 0 && account.has_password()) {
auto password = Core::get_password(); auto password = Core::get_password();