Merge branch 'main' into wt/t_fc02d8b6
All checks were successful
ci / test (pull_request) Successful in 3m2s
All checks were successful
ci / test (pull_request) Successful in 3m2s
This commit is contained in:
commit
dcb98132e2
13 changed files with 552 additions and 21 deletions
|
|
@ -12,6 +12,7 @@ use rand::RngCore;
|
|||
use sha2::{Digest, Sha256};
|
||||
|
||||
use crate::frame;
|
||||
use crate::sanitize;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
|
|
@ -79,6 +80,7 @@ pub fn safe_name(name: &str) -> Result<&str> {
|
|||
|| name.contains('\n')
|
||||
|| name == ".."
|
||||
|| name == "."
|
||||
|| name.chars().any(sanitize::is_control_or_bidi)
|
||||
{
|
||||
return Err(Error("bad file name".into()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue