mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
fix: reject symlinked config and output parents
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
ed8ce593e2
commit
93b7196dd6
@@ -52,11 +52,16 @@ impl FileSystemHandler {
|
||||
&self,
|
||||
params: FsReadFileParams,
|
||||
) -> Result<FsReadFileResponse, JSONRPCErrorError> {
|
||||
let bytes = self
|
||||
.file_system
|
||||
.read_file(¶ms.path, params.sandbox.as_ref())
|
||||
.await
|
||||
.map_err(map_fs_error)?;
|
||||
let bytes = if params.no_follow_symlinks {
|
||||
self.file_system
|
||||
.read_file_no_follow(¶ms.path, params.sandbox.as_ref())
|
||||
.await
|
||||
} else {
|
||||
self.file_system
|
||||
.read_file(¶ms.path, params.sandbox.as_ref())
|
||||
.await
|
||||
}
|
||||
.map_err(map_fs_error)?;
|
||||
Ok(FsReadFileResponse {
|
||||
data_base64: STANDARD.encode(bytes),
|
||||
})
|
||||
@@ -269,6 +274,7 @@ mod tests {
|
||||
sandbox_policy,
|
||||
sandbox_cwd.clone(),
|
||||
)),
|
||||
no_follow_symlinks: false,
|
||||
})
|
||||
.await
|
||||
.expect("read file");
|
||||
|
||||
Reference in New Issue
Block a user