Skip to content

Commit 6df7365

Browse files
committed
Address review comment: use os.stat with follow_symlinks to correctly handle symlinks
1 parent 735a36f commit 6df7365

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/agents/sandbox/fs-bridge-mutation-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ export const SANDBOX_PINNED_MUTATION_PYTHON = [
8989
" # Preserve original file permissions if file exists",
9090
" original_mode = None",
9191
" try:",
92-
" original_stat = os.lstat(basename, dir_fd=parent_fd)",
92+
" original_stat = os.stat(basename, dir_fd=parent_fd, follow_symlinks=True)",
9393
" original_mode = stat.S_IMODE(original_stat.st_mode)",
9494
" except OSError:",
95-
" pass # File doesn't exist, use default permissions",
95+
" pass # File doesn't exist or can't be stat'd, use default permissions",
9696
" temp_name, temp_fd = create_temp_file(parent_fd, basename)",
9797
" while True:",
9898
" chunk = stdin_buffer.read(65536)",

0 commit comments

Comments
 (0)