Files
DroidDeck/tools/fex/patches/0017-fd-exec-keeps-argv0-and-path.patch
T
MaxsTechReview afe81ea69f fix(fex): x86-64 DwarFS AppImages start and GLib programs reach D-Bus (#3162)
* fix(fex): a program run from a descriptor keeps its argv[0] and an absolute /proc/self/exe

* fix(fex): 64-bit programs send their socket credentials through the hook

D-Bus clients fill SCM_CREDENTIALS with getuid(), which is 0 under the guest. FEX sent x86-64 sendmsg straight to the kernel, which refused the fake root uid with EPERM, so GLib programs lost the session bus and every portal. sendmsg, recvmsg and getsockopt now go through libc like the identity calls, so the hook puts in the real ids and shows the peer as root.
2026-11-24 16:21:40 -05:00

27 lines
1.4 KiB
Diff

diff --git a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp
index 2881ad9..abc84f3 100644
--- a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp
+++ b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp
@@ -518,7 +518,7 @@ int main(int argc, char** argv, char** const envp) {
FEXCore::Config::Set(FEXCore::Config::CONFIG_APP_CONFIG_NAME, Program.ProgramName);
} else {
// Anonymous program.
- FEXCore::Config::Set(FEXCore::Config::CONFIG_APP_FILENAME, "<Anonymous>");
+ FEXCore::Config::Set(FEXCore::Config::CONFIG_APP_FILENAME, Program.ProgramPath);
FEXCore::Config::Set(FEXCore::Config::CONFIG_APP_CONFIG_NAME, "<Anonymous>");
}
} else {
diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
index a7a432b..4a77d87 100644
--- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
+++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
@@ -441,7 +441,7 @@ uint64_t ExecveHandler(FEXCore::Core::CpuStateFrame* Frame, const char* pathname
if (*OldArgv) {
// The direct fallback uses the executable path as argv[0]. An FD-backed load uses the
// binfmt preserve-argv0 layout, so the caller-supplied argv[0] has to stay in the vector.
- if (!NeedsLoaderFD) {
+ if (!NeedsLoaderFD && !IsFDExec) {
++OldArgv;
}
while (*OldArgv) {