mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 20:24:21 +00:00
fix: create explicit CODEX_HOME with secure permissions (#1380)
This commit is contained in:
@@ -222,7 +222,7 @@ function prepareExplicitCodexHome(
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(codexHome, { recursive: true });
|
fs.mkdirSync(codexHome, { mode: 0o700, recursive: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const error = err as NodeJS.ErrnoException;
|
const error = err as NodeJS.ErrnoException;
|
||||||
if (error.code !== 'EEXIST') {
|
if (error.code !== 'EEXIST') {
|
||||||
|
|||||||
@@ -596,7 +596,9 @@ process.exit(0);
|
|||||||
|
|
||||||
expect(result.status).toBe(0);
|
expect(result.status).toBe(0);
|
||||||
expect(fs.existsSync(freshCodexHome)).toBe(true);
|
expect(fs.existsSync(freshCodexHome)).toBe(true);
|
||||||
expect(fs.statSync(freshCodexHome).isDirectory()).toBe(true);
|
const codexHomeStat = fs.statSync(freshCodexHome);
|
||||||
|
expect(codexHomeStat.isDirectory()).toBe(true);
|
||||||
|
expect(codexHomeStat.mode & 0o777).toBe(0o700);
|
||||||
expect(readLoggedCodexCalls(codexArgsLogPath)).toEqual([
|
expect(readLoggedCodexCalls(codexArgsLogPath)).toEqual([
|
||||||
['-c', 'model="gpt-5"', '--version'],
|
['-c', 'model="gpt-5"', '--version'],
|
||||||
['-c', 'model_reasoning_effort="high"', 'fix failing tests'],
|
['-c', 'model_reasoning_effort="high"', 'fix failing tests'],
|
||||||
|
|||||||
Reference in New Issue
Block a user