mirror of
https://github.com/openai/codex.git
synced 2026-05-04 05:11:37 +03:00
Fix fs/readDirectory to skip broken symlinks (#17907)
## Summary - Skip directory entries whose metadata lookup fails during `fs/readDirectory` - Add an exec-server regression test covering a broken symlink beside valid entries ## Testing - `just fmt` - `cargo test -p codex-exec-server` (started, but dependency/network updates stalled before completion in this environment)
This commit is contained in:
@@ -305,7 +305,9 @@ impl ExecutorFileSystem for DirectFileSystem {
|
||||
let mut entries = Vec::new();
|
||||
let mut read_dir = tokio::fs::read_dir(path.as_path()).await?;
|
||||
while let Some(entry) = read_dir.next_entry().await? {
|
||||
let metadata = tokio::fs::metadata(entry.path()).await?;
|
||||
let Ok(metadata) = tokio::fs::metadata(entry.path()).await else {
|
||||
continue;
|
||||
};
|
||||
entries.push(ReadDirectoryEntry {
|
||||
file_name: entry.file_name().to_string_lossy().into_owned(),
|
||||
is_directory: metadata.is_dir(),
|
||||
|
||||
Reference in New Issue
Block a user