mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 00:00:41 +02:00
Linux/FM: Follow more symlinks in emulation
Depending on how wine is launching it may do a PATH scan. So we need to follow symlinks in a few more syscalls
This commit is contained in:
1 parent
a393d6609f
commit
decd8bec31
1 file changed
+6
-3
@@ -365,7 +365,8 @@ uint64_t FileManager::Stat(const char *pathname, void *buf) {
|
||||
auto NewPath = GetSelf(pathname);
|
||||
const char *SelfPath = NewPath ? NewPath->c_str() : nullptr;
|
||||
|
||||
auto Path = GetEmulatedPath(SelfPath);
|
||||
// Stat follows symlinks
|
||||
auto Path = GetEmulatedPath(SelfPath, true);
|
||||
if (!Path.empty()) {
|
||||
uint64_t Result = ::stat(Path.c_str(), reinterpret_cast<struct stat*>(buf));
|
||||
if (Result != -1)
|
||||
@@ -378,7 +379,8 @@ uint64_t FileManager::Lstat(const char *pathname, void *buf) {
|
||||
auto NewPath = GetSelf(pathname);
|
||||
const char *SelfPath = NewPath ? NewPath->c_str() : nullptr;
|
||||
|
||||
auto Path = GetEmulatedPath(SelfPath);
|
||||
// lstat does not follow symlinks
|
||||
auto Path = GetEmulatedPath(SelfPath, false);
|
||||
if (!Path.empty()) {
|
||||
uint64_t Result = ::lstat(Path.c_str(), reinterpret_cast<struct stat*>(buf));
|
||||
if (Result != -1)
|
||||
@@ -392,7 +394,8 @@ uint64_t FileManager::Access(const char *pathname, [[maybe_unused]] int mode) {
|
||||
auto NewPath = GetSelf(pathname);
|
||||
const char *SelfPath = NewPath ? NewPath->c_str() : nullptr;
|
||||
|
||||
auto Path = GetEmulatedPath(SelfPath);
|
||||
// Access follows symlinks
|
||||
auto Path = GetEmulatedPath(SelfPath, true);
|
||||
if (!Path.empty()) {
|
||||
uint64_t Result = ::access(Path.c_str(), mode);
|
||||
if (Result != -1)
|
||||
|
||||
Reference in new issue
Block a user