LibCore: Use the user's root session ID for standard runtime path

This ensures processes created by the user use the same runtime path.
This commit is contained in:
Timothy Flynn 2022-12-15 07:18:15 -05:00 committed by Linus Groh
parent e2566d5126
commit 701e77019c
Notes: sideshowbarker 2024-07-17 16:23:55 +09:00

View File

@ -8,8 +8,8 @@
#include <AK/LexicalPath.h>
#include <AK/Platform.h>
#include <AK/StringBuilder.h>
#include <LibCore/SessionManagement.h>
#include <LibCore/StandardPaths.h>
#include <LibCore/System.h>
#include <pwd.h>
#include <stdlib.h>
#include <unistd.h>
@ -92,7 +92,7 @@ ErrorOr<DeprecatedString> StandardPaths::runtime_directory()
StringBuilder builder;
#if defined(AK_OS_SERENITY)
auto sid = TRY(Core::System::getsid());
auto sid = TRY(Core::SessionManagement::root_session_id());
builder.appendff("/tmp/session/{}", sid);
#elif defined(AK_OS_MACOS)
builder.append(home_directory());