mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
validateTrashName blocks absolute trash names with filepath.IsAbs, but that predicate is platform-dependent: on Windows "/absolute/path" carries no volume, so IsAbs reports false and MoveToTrash accepted a name the guard documents as rejected. A leading separator is never a valid trash name on any platform, so reject it explicitly. The security helper compared filepath.Rel output against a slash-form allow-list, which never matches on Windows, so every case in TestMoveToTrash_RejectsTraversal also reported the untouched canary file as "written outside base"; normalizing with filepath.ToSlash keeps the assertion truthful on both platforms.