Check for other issues
Issue description
When users attempt to add their Downloads folder (or any user directory for that matter) as a library location in Spacedrive on Windows, it is incorrectly flagged as a "High Risk Path" with the warning "This is a system directory that contains OS files".
Root Cause
In core/src/ops/locations/validate/query.rs, the get_system_directories() function includes C:\ in the system directories list:
#[cfg(target_os = "windows")]
{
vec![
PathBuf::from("C:\\"),
PathBuf::from("C:\\Windows"),
PathBuf::from("C:\\Program Files"),
// ...
]
}
The validation logic uses path.starts_with():
is_system_dir = system_dirs.iter().any(|d| path.starts_with(d));
Since every path on the C: drive starts with C:, all user directories are incorrectly caught by this check.
Steps to reproduce
Steps to Reproduce
- Open Spacedrive desktop application
- Navigate to "Add Location" or "Configure Location"
- Select the Desktop folder (C:\Users[USERNAME]\Downloads)
- Observe the warning: "High Risk Path Detected - This is a system directory that contains OS files"
Platform and versions
OS: windows
Stack trace
Additional context
No response
Code of Conduct
Check for other issues
Issue description
When users attempt to add their Downloads folder (or any user directory for that matter) as a library location in Spacedrive on Windows, it is incorrectly flagged as a "High Risk Path" with the warning "This is a system directory that contains OS files".
Root Cause
In core/src/ops/locations/validate/query.rs, the get_system_directories() function includes C:\ in the system directories list:
The validation logic uses path.starts_with():
is_system_dir = system_dirs.iter().any(|d| path.starts_with(d));Since every path on the C: drive starts with C:, all user directories are incorrectly caught by this check.
Steps to reproduce
Steps to Reproduce
Platform and versions
OS: windows
Stack trace
Additional context
No response
Code of Conduct