Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Amazon Q Chat: Set owner-only permissions for chat history and saved prompt files"
}
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export class ChatController {
title ? `${title}${promptFileExtension}` : `default${promptFileExtension}`
)
const newFileContent = new Uint8Array(Buffer.from(''))
await fs.writeFile(newFilePath, newFileContent)
await fs.writeFile(newFilePath, newFileContent, { mode: 0o600 })
const newFileDoc = await vscode.workspace.openTextDocument(newFilePath)
await vscode.window.showTextDocument(newFileDoc)
telemetry.ui_click.emit({ elementId: 'amazonq_createSavedPrompt' })
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/shared/db/chatDb/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class FileSystemAdapter implements LokiPersistenceAdapter {
await this.ensureDirectory()
const filename = path.join(this.directory, dbname)

await fs.writeFile(filename, dbstring, 'utf8')
await fs.writeFile(filename, dbstring, { mode: 0o600, encoding: 'utf8' })
callback(undefined)
} catch (err: any) {
callback(err)
Expand Down
Loading