mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
[rpcsx-os] shm: escape subdirectories
This commit is contained in:
parent
1d3a3949f3
commit
74aa1a112e
|
|
@ -19,12 +19,16 @@ orbis::ErrorCode ShmDevice::open(orbis::Ref<orbis::File> *file,
|
|||
ORBIS_LOG_WARNING("shm_open", path, flags, mode);
|
||||
|
||||
std::string name = "/rpcsx-";
|
||||
if (std::string_view{path}.starts_with("/")) {
|
||||
if (path[0] == '/') {
|
||||
name += path + 1;
|
||||
} else {
|
||||
name += path;
|
||||
}
|
||||
|
||||
for (auto pos = name.find('/', 1); pos != std::string::npos; pos = name.find('/', pos + 1)) {
|
||||
name[pos] = '$';
|
||||
}
|
||||
|
||||
auto realFlags = O_RDWR; // TODO
|
||||
|
||||
std::size_t size = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue