feat(tools/file): write_file atomic + 0600
This commit is contained in:
1 parent
c4750347e6
commit
7ae944f0eb
2 files changed
+27
-1
No files matched your search
@@ -72,7 +72,7 @@ func (t *WriteFileTool) Execute(_ context.Context, input json.RawMessage) (tool.
|
||||
return tool.ToolResult{Error: fmt.Sprintf("failed to create directory: %v", err)}, nil
|
||||
}
|
||||
|
||||
if err := os.WriteFile(in.Path, []byte(in.Content), 0o644); err != nil {
|
||||
if err := tool.WriteFileAtomic(in.Path, []byte(in.Content), 0o600); err != nil {
|
||||
return tool.ToolResult{Error: fmt.Sprintf("failed to write file: %v", err)}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user