Skip to content

User Directory Such As Downloads Incorrectly Flagged as High Risk Path on Windows #3017

@Nebhay

Description

@Nebhay

Check for other issues

  • I've checked for other issues, and none exist.

Issue description

Image

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

  1. Open Spacedrive desktop application
  2. Navigate to "Add Location" or "Configure Location"
  3. Select the Desktop folder (C:\Users[USERNAME]\Downloads)
  4. 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

  • I agree to follow the Code of Conduct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions