Revert "Accept only decimal digits in file names inside snapshot (#21213) (#21281)"

This reverts commit d4192e3ac4.
This commit is contained in:
Trent Nelson
2021-12-13 08:48:40 -07:00
committed by Tao Zhu
parent fa83e05d2c
commit 23be4d89ef

View File

@ -346,7 +346,7 @@ fn all_digits(v: &str) -> bool {
return false;
}
for x in v.chars() {
if !x.is_digit(10) {
if !x.is_numeric() {
return false;
}
}
@ -357,7 +357,7 @@ fn like_storage(v: &str) -> bool {
let mut periods = 0;
let mut saw_numbers = false;
for x in v.chars() {
if !x.is_digit(10) {
if !x.is_numeric() {
if x == '.' {
if periods > 0 || !saw_numbers {
return false;
@ -521,10 +521,6 @@ mod tests {
&["snapshots", "0x"],
tar::EntryType::Directory
));
assert!(!is_valid_snapshot_archive_entry(
&["snapshots", ""],
tar::EntryType::Directory
));
assert!(!is_valid_snapshot_archive_entry(
&["snapshots", "0", "aa"],
tar::EntryType::Regular
@ -571,10 +567,6 @@ mod tests {
&["accounts", "232323"],
tar::EntryType::Regular
));
assert!(!is_valid_snapshot_archive_entry(
&["accounts", "৬.¾"],
tar::EntryType::Regular
));
}
#[test]