{"record":{"id":"1a5bbe42f13d4c31","repo":"yorukot/superfile","slug":"trash-directory-s-is-not-owned-by-current-user","errorCode":null,"errorMessage":"trash directory %s is not owned by current user","messagePattern":"trash directory (.+?) is not owned by current user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/internal/trash/trash_linux.go","lineNumber":205,"sourceCode":"\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc ensureOwnedPrivateTrash(path string) error {\n\tinfo, err := os.Lstat(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif info.Mode()&os.ModeSymlink != 0 {\n\t\treturn fmt.Errorf(\"refusing symlink trash directory %s\", path)\n\t}\n\tif !info.IsDir() {\n\t\treturn fmt.Errorf(\"trash path %s is not a directory\", path)\n\t}\n\tif stat, ok := info.Sys().(*syscall.Stat_t); ok && int(stat.Uid) != os.Getuid() {\n\t\treturn fmt.Errorf(\"trash directory %s is not owned by current user\", path)\n\t}\n\tif info.Mode().Perm()&0o077 != 0 {\n\t\t//nolint:gosec // Directory execute bit is required; trash directories are restricted to the owner.\n\t\tif err := os.Chmod(path, 0o700); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to restrict trash directory %s: %w\", path, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validSharedTrash(path string) bool {\n\tinfo, err := os.Lstat(path)\n\tif err != nil || !info.IsDir() || info.Mode()&os.ModeSymlink != 0 {\n\t\treturn false\n\t}\n\treturn info.Mode()&os.ModeSticky != 0\n}\n","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/yorukot/superfile/blob/b72f550bc6e75913f48eb49fdd258e1a2df2fe88/src/internal/trash/trash_linux.go#L187-L223","documentation":"Error \"trash directory %s is not owned by current user\" thrown in yorukot/superfile.","triggerScenarios":"Thrown at src/internal/trash/trash_linux.go:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b72f550bc6e75913f48eb49fdd258e1a2df2fe88","analyzedAt":"2026-09-01T04:38:08.254Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}