Confine cleanup and use held session locks
This commit is contained in:
@@ -515,7 +515,7 @@ func clearManagedPreviousState(paths artifacts.SessionPaths) error {
|
||||
if filepath.Base(previousDir) != config.PathPreviousDirSegment {
|
||||
return fmt.Errorf("refusing to clear non-previous path %q", previousDir)
|
||||
}
|
||||
if err := os.RemoveAll(previousDir); err != nil {
|
||||
if err := fileops.RemoveAllUnderRoot(sessionRoot, previousDir); err != nil {
|
||||
return err
|
||||
}
|
||||
return fileops.EnsureWorkspaceDirectory(previousDir)
|
||||
|
||||
Reference in New Issue
Block a user