mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibCore: Make Core::System::unveil
aware of %uid in path
This brings support for user-dependent paths in `unveil`.
This commit is contained in:
parent
1b36348d8b
commit
9cfd1b1a67
1 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/Account.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <limits.h>
|
||||
|
@ -81,8 +82,10 @@ ErrorOr<void> pledge(StringView promises, StringView execpromises)
|
|||
|
||||
ErrorOr<void> unveil(StringView path, StringView permissions)
|
||||
{
|
||||
auto const parsed_path = Core::Account::parse_path_with_uid(path);
|
||||
|
||||
Syscall::SC_unveil_params params {
|
||||
{ path.characters_without_null_termination(), path.length() },
|
||||
{ parsed_path.characters(), parsed_path.length() },
|
||||
{ permissions.characters_without_null_termination(), permissions.length() },
|
||||
};
|
||||
int rc = syscall(SC_unveil, ¶ms);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue