mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-21 08:29:59 +00:00
Fixed scan depth check
This commit is contained in:
parent
87e8b3be6a
commit
6c98228726
@ -251,6 +251,10 @@ bool RascsiImage::RenameImage(int fd, const PbCommand& command)
|
||||
return ReturnStatus(fd, false, "Can't rename image file: Missing source filename");
|
||||
}
|
||||
|
||||
if (!CheckDepth(from)) {
|
||||
return ReturnStatus(fd, false, ("Invalid folder hierarchy depth '" + from + "'").c_str());
|
||||
}
|
||||
|
||||
from = default_image_folder + "/" + from;
|
||||
if (!IsValidSrcFilename(from)) {
|
||||
return ReturnStatus(fd, false, "Can't rename image file: '" + from + "': Invalid name or type");
|
||||
@ -261,10 +265,6 @@ bool RascsiImage::RenameImage(int fd, const PbCommand& command)
|
||||
return ReturnStatus(fd, false, "Can't rename image file '" + from + "': Missing destination filename");
|
||||
}
|
||||
|
||||
if (!CheckDepth(from)) {
|
||||
return ReturnStatus(fd, false, ("Invalid folder hierarchy depth '" + from + "'").c_str());
|
||||
}
|
||||
|
||||
if (!CheckDepth(to)) {
|
||||
return ReturnStatus(fd, false, ("Invalid folder hierarchy depth '" + to + "'").c_str());
|
||||
}
|
||||
@ -294,6 +294,10 @@ bool RascsiImage::CopyImage(int fd, const PbCommand& command)
|
||||
return ReturnStatus(fd, false, "Can't copy image file: Missing source filename");
|
||||
}
|
||||
|
||||
if (!CheckDepth(from)) {
|
||||
return ReturnStatus(fd, false, ("Invalid folder hierarchy depth '" + from + "'").c_str());
|
||||
}
|
||||
|
||||
from = default_image_folder + "/" + from;
|
||||
if (!IsValidSrcFilename(from)) {
|
||||
return ReturnStatus(fd, false, "Can't copy image file: '" + from + "': Invalid name or type");
|
||||
@ -304,10 +308,6 @@ bool RascsiImage::CopyImage(int fd, const PbCommand& command)
|
||||
return ReturnStatus(fd, false, "Can't copy image file '" + from + "': Missing destination filename");
|
||||
}
|
||||
|
||||
if (!CheckDepth(from)) {
|
||||
return ReturnStatus(fd, false, ("Invalid folder hierarchy depth '" + from + "'").c_str());
|
||||
}
|
||||
|
||||
if (!CheckDepth(to)) {
|
||||
return ReturnStatus(fd, false, ("Invalid folder hierarchy depth '" + to + "'").c_str());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user