mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 00:17:09 +00:00
fix(claude-extension): enforce private permissions for settings writes (#1378)
This commit is contained in:
1 parent
210ab761e2
commit
0db9705d75
2 files changed
+14
-2
No files matched your search
@@ -231,8 +231,12 @@ function writeJsonDocument(
|
||||
const tempPath = `${filePath}.tmp.${uniqueFileNonce()}`;
|
||||
|
||||
try {
|
||||
fs.writeFileSync(tempPath, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
||||
fs.writeFileSync(tempPath, JSON.stringify(data, null, 2) + '\n', {
|
||||
encoding: 'utf8',
|
||||
mode: 0o600,
|
||||
});
|
||||
fs.renameSync(tempPath, filePath);
|
||||
fs.chmodSync(filePath, 0o600);
|
||||
} catch (error) {
|
||||
if (fs.existsSync(tempPath)) {
|
||||
fs.rmSync(tempPath, { force: true });
|
||||
|
||||
Reference in new issue
Block a user