mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
fix(libkernel): reject empty mkdir paths
This commit is contained in:
1 parent
734fe53f82
commit
046680da48
2 files changed
+2
No files matched your search
@@ -544,6 +544,7 @@ int APS5_VABI getdents_nid_postfix(int fd, char* buf, int nbytes) {
|
||||
int APS5_VABI sceKernelMkdir(const char* path, uint16_t mode) {
|
||||
(void)mode;
|
||||
if (path == nullptr) throw std::invalid_argument("sceKernelMkdir: path is null");
|
||||
if (!*path) return SceErrorFromErrno(GUEST_ENOENT);
|
||||
auto native = ResolvePath_nid_no_patch(path);
|
||||
while (!native.has_filename() && native.has_relative_path()) native = native.parent_path();
|
||||
std::error_code error;
|
||||
|
||||
@@ -37,6 +37,7 @@ static bool Recorded(const char* guest) {
|
||||
}
|
||||
int main() {
|
||||
std::filesystem::remove_all("kernel_sync_probe");
|
||||
Require(sceKernelMkdir("", 0777) == static_cast<int>(0x80020002u));
|
||||
Require(sceKernelMkdir("/", 0777) == static_cast<int>(0x80020011u));
|
||||
Require(sceKernelMkdir("kernel_sync_probe", 0777) == 0);
|
||||
Require(Recorded("kernel_sync_probe"));
|
||||
|
||||
Reference in new issue
Block a user