check whether entry is file. avoids 'raou .' panic
This commit is contained in:
父節點
9f2f0e66b2
當前提交
aaa6670eda
@ -262,6 +262,12 @@ fn exec(entryname: &str, cmdargs: &Vec<String>) -> std::io::Result<()> {
|
|||||||
"Specified entry is outside base directory",
|
"Specified entry is outside base directory",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
if ! p.is_file() {
|
||||||
|
return Err(std::io::Error::new(
|
||||||
|
ErrorKind::Other,
|
||||||
|
"Error: Entry not a file",
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e.kind() == ErrorKind::NotFound {
|
if e.kind() == ErrorKind::NotFound {
|
||||||
|
載入中…
x
新增問題並參考
Block a user