fix: pin parent directory and verify owner/type before trashing Trash renamed the item by path after the confirmation dialog, so a parent directory swapped for a symlink since the scan (e.g. by another user, while an administrator cleans their home) redirected the move to an unrelated file. The parent is now opened once and the item is checked (owner and file type as scanned) and renamed relative to that fd. macOS volume trash directories now get the same ownership/symlink checks as freedesktop.org ones on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
418 B
Go
15 lines
418 B
Go
//go:build !linux && !darwin && !windows
|
|
|
|
package platform
|
|
|
|
import "errors"
|
|
|
|
// TrashName is the user-facing name of the trash.
|
|
const TrashName = "trash"
|
|
|
|
// Reveal is unsupported on this platform.
|
|
func Reveal(string) error { return errors.New("not supported on this platform") }
|
|
|
|
// Trash is unsupported on this platform.
|
|
func Trash(string, Expect) error { return errors.New("trash not supported on this platform") }
|