mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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
Notes:
sideshowbarker
2024-07-17 06:34:33 +09:00
Author: https://github.com/LucasChollet
Commit: e1edd620ee
Pull-request: https://github.com/SerenityOS/serenity/pull/14860
Issue: https://github.com/SerenityOS/serenity/issues/13437
Reviewed-by: https://github.com/AtkinsSJ ✅
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