From eb5e0be5693429b53ead24cc1ebf6308182a24c0 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 22 Sep 2023 17:45:04 -0700 Subject: [PATCH] FEXServerClient: Adds back ServerSocketPath config option This option was disabled a few months ago when we switched the server socket from a filesystem unix socket to an abstract socket. This partially broke our chroot scripts which relied on this option existing. Readds support for an explicitly named abstract socket named from config. This is a workaround for dealing with chroots that change users. They end up changing a user while doing operations and then can't connect to the FEXServer anymore because environment variables have been wiped away. --- Source/Common/FEXServerClient.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Common/FEXServerClient.cpp b/Source/Common/FEXServerClient.cpp index eed92bda5..2cfaabd86 100644 --- a/Source/Common/FEXServerClient.cpp +++ b/Source/Common/FEXServerClient.cpp @@ -3,6 +3,7 @@ #include "Common/FEXServerClient.h" #include +#include #include #include #include @@ -143,7 +144,11 @@ namespace FEXServerClient { } fextl::string GetServerSocketName() { - return fextl::fmt::format("{}.FEXServer.Socket", ::geteuid()); + FEX_CONFIG_OPT(ServerSocketPath, SERVERSOCKETPATH); + if (ServerSocketPath().empty()) { + return fextl::fmt::format("{}.FEXServer.Socket", ::geteuid()); + } + return ServerSocketPath; } int GetServerFD() {