mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
pls: Use LibCore::Account::login()
instead of manually setting the uid
In addition to changing the uid, the method also changes the gid and properly sets groups. So this patch will also mitigate the security issue of `pls`.
This commit is contained in:
parent
8fabe9a3ad
commit
e1edd620ee
1 changed files with 1 additions and 2 deletions
|
@ -42,8 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::pledge("stdio rpath exec id"));
|
||||
|
||||
TRY(Core::System::setgid(0));
|
||||
TRY(Core::System::setuid(as_user_uid));
|
||||
TRY(as_user.login());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath exec"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue