1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

Kernel: Make File::{chown,chmod} take credentials as input

...instead of getting them from Process::current(). :^)
This commit is contained in:
Andreas Kling 2022-08-21 16:15:29 +02:00
parent c3351d4b9f
commit 006f753647
10 changed files with 26 additions and 23 deletions

View file

@ -17,7 +17,7 @@ ErrorOr<FlatPtr> Process::sys$fchown(int fd, UserID uid, GroupID gid)
VERIFY_NO_PROCESS_BIG_LOCK(this);
TRY(require_promise(Pledge::chown));
auto description = TRY(open_file_description(fd));
TRY(description->chown(uid, gid));
TRY(description->chown(credentials(), uid, gid));
return 0;
}