diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2023-05-19 22:04:13 +0200 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-05-19 22:42:02 +0200 |
commit | 58ea30f85a07fe4d6b157b5a796b040566d5c8c8 (patch) | |
tree | b48741dedb0022eadfc2f999cb7e52bc1c2c6314 | |
parent | d43d51eedcc1778b8dbedcdcbc8dbf24dbe75390 (diff) | |
download | serenity-58ea30f85a07fe4d6b157b5a796b040566d5c8c8.zip |
aplay: Determine absolute path before raising the veil
This was a regression introduced in 25d2828e, #18807. In that commit, I
forgot to investigate why the order of operations was so "weird", so I
added a comment this time to prevent future regressions.
-rw-r--r-- | Userland/Utilities/aplay.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Utilities/aplay.cpp b/Userland/Utilities/aplay.cpp index 5210646a16..07e0eb4fd3 100644 --- a/Userland/Utilities/aplay.cpp +++ b/Userland/Utilities/aplay.cpp @@ -35,8 +35,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) args_parser.add_option(show_sample_progress, "Show playback progress in samples", "sample-progress", 's'); args_parser.parse(arguments); + // Note: We must determine the absolute path *before* beginning to raise the veil. + auto absolute_path = TRY(FileSystem::absolute_path(path)); + TRY(Core::System::unveil("/tmp/session/%sid/portal/audio", "rw")); - TRY(Core::System::unveil(TRY(FileSystem::absolute_path(path)), "r"sv)); + TRY(Core::System::unveil(absolute_path, "r"sv)); TRY(Core::System::unveil(nullptr, nullptr)); Core::EventLoop loop; |