cellPhotoDecodeFromFile: allow decoding files inside dev_hdd1

This commit is contained in:
Megamouse 2023-10-22 10:05:45 +02:00
parent f9d213650c
commit 07da8d5e36

View File

@ -144,15 +144,14 @@ error_code cellPhotoDecodeFromFile(vm::cptr<char> srcHddDir, vm::cptr<char> srcH
const std::string vpath = fmt::format("%s/%s", srcHddDir.get_ptr(), srcHddFile.get_ptr());
const std::string path = vfs::get(vpath);
if (!vpath.starts_with("/dev_hdd0"))
if (!vpath.starts_with("/dev_hdd0") && !vpath.starts_with("/dev_hdd1"))
{
cellPhotoDecode.error("Destination '%s' is not inside dev_hdd0", srcHddDir);
cellPhotoDecode.error("Source '%s' is not inside dev_hdd0 or dev_hdd1", vpath);
return CELL_PHOTO_DECODE_ERROR_ACCESS_ERROR; // TODO: is this correct?
}
if (!fs::is_file(path))
{
// TODO: check if the dir is user accessible and can be written to
cellPhotoDecode.error("Source '%s' is not a file (vfs='%s')", path, vpath);
return CELL_PHOTO_DECODE_ERROR_ACCESS_ERROR; // TODO: is this correct?
}