mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-30 08:49:26 +00:00
fix: troubleshooting startup failure in Windows System
This commit is contained in:
@@ -145,8 +145,8 @@ impl Debug for LocalDisk {
|
|||||||
impl LocalDisk {
|
impl LocalDisk {
|
||||||
pub async fn new(ep: &Endpoint, cleanup: bool) -> Result<Self> {
|
pub async fn new(ep: &Endpoint, cleanup: bool) -> Result<Self> {
|
||||||
debug!("Creating local disk");
|
debug!("Creating local disk");
|
||||||
let root = match fs::canonicalize(ep.get_file_path()).await {
|
let root = match PathBuf::from(ep.get_file_path()).absolutize() {
|
||||||
Ok(path) => path,
|
Ok(path) => path.into_owned(),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e.kind() == ErrorKind::NotFound {
|
if e.kind() == ErrorKind::NotFound {
|
||||||
return Err(DiskError::VolumeNotFound);
|
return Err(DiskError::VolumeNotFound);
|
||||||
|
|||||||
@@ -2508,14 +2508,14 @@ fn check_object_name_for_length_and_slash(bucket: &str, object: &str) -> Result<
|
|||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
if object.contains('\\')
|
if object.contains(':')
|
||||||
|| object.contains(':')
|
|
||||||
|| object.contains('*')
|
|| object.contains('*')
|
||||||
|| object.contains('?')
|
|| object.contains('?')
|
||||||
|| object.contains('"')
|
|| object.contains('"')
|
||||||
|| object.contains('|')
|
|| object.contains('|')
|
||||||
|| object.contains('<')
|
|| object.contains('<')
|
||||||
|| object.contains('>')
|
|| object.contains('>')
|
||||||
|
// || object.contains('\\')
|
||||||
{
|
{
|
||||||
return Err(StorageError::ObjectNameInvalid(bucket.to_owned(), object.to_owned()));
|
return Err(StorageError::ObjectNameInvalid(bucket.to_owned(), object.to_owned()));
|
||||||
}
|
}
|
||||||
@@ -2549,9 +2549,9 @@ fn check_bucket_and_object_names(bucket: &str, object: &str) -> Result<()> {
|
|||||||
return Err(StorageError::ObjectNameInvalid(bucket.to_string(), object.to_string()));
|
return Err(StorageError::ObjectNameInvalid(bucket.to_string(), object.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg!(target_os = "windows") && object.contains('\\') {
|
// if cfg!(target_os = "windows") && object.contains('\\') {
|
||||||
return Err(StorageError::ObjectNameInvalid(bucket.to_string(), object.to_string()));
|
// return Err(StorageError::ObjectNameInvalid(bucket.to_string(), object.to_string()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user