Kernel: Require keymap loading superuser privileges

This commit is contained in:
Bananymous 2024-01-10 14:50:30 +02:00
parent 51214ea1bf
commit ab39c6541a
1 changed files with 3 additions and 0 deletions

View File

@ -1260,6 +1260,9 @@ namespace Kernel
LockGuard _(m_lock);
TRY(validate_string_access(path));
if (!m_credentials.is_superuser())
return BAN::Error::from_errno(EPERM);
auto absolute_path = TRY(absolute_path_of(path));
TRY(Input::KeyboardLayout::get().load_from_file(absolute_path));
return 0;