yorukot/superfile · error
failed to restrict trash directory %s: %w
Error message
failed to restrict trash directory %s: %w
What it means
Error "failed to restrict trash directory %s: %w" thrown in yorukot/superfile.
Source
Thrown at src/internal/trash/trash_linux.go:210
func ensureOwnedPrivateTrash(path string) error {
info, err := os.Lstat(path)
if err != nil {
return err
}
if info.Mode()&os.ModeSymlink != 0 {
return fmt.Errorf("refusing symlink trash directory %s", path)
}
if !info.IsDir() {
return fmt.Errorf("trash path %s is not a directory", path)
}
if stat, ok := info.Sys().(*syscall.Stat_t); ok && int(stat.Uid) != os.Getuid() {
return fmt.Errorf("trash directory %s is not owned by current user", path)
}
if info.Mode().Perm()&0o077 != 0 {
//nolint:gosec // Directory execute bit is required; trash directories are restricted to the owner.
if err := os.Chmod(path, 0o700); err != nil {
return fmt.Errorf("failed to restrict trash directory %s: %w", path, err)
}
}
return nil
}
func validSharedTrash(path string) bool {
info, err := os.Lstat(path)
if err != nil || !info.IsDir() || info.Mode()&os.ModeSymlink != 0 {
return false
}
return info.Mode()&os.ModeSticky != 0
}
func reserveTrashInfo(td linuxTrashDir, srcAbs string) (string, string, string, error) {
base := filepath.Base(srcAbs)
if base == "." || base == string(filepath.Separator) || base == "" {
return "", "", "", fmt.Errorf("invalid trash source %s", srcAbs)
}View on GitHub (pinned to b72f550bc6)
When it happens
Trigger: Thrown at src/internal/trash/trash_linux.go:210 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of yorukot/superfile@b72f550bc6 (2026-09-01).
Data as JSON: /api/errors/a2c7b0543c6921f8.
Report an issue: GitHub.