mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
pre-create and chmod 600 data file (#182)
This commit is contained in:
@@ -22,6 +22,10 @@ export class LowdbStorageService implements StorageService {
|
||||
NodeUtils.mkdirpSync(dir, '700');
|
||||
}
|
||||
this.dataFilePath = path.join(dir, 'data.json');
|
||||
if (!fs.existsSync(this.dataFilePath)) {
|
||||
fs.writeFileSync(this.dataFilePath, '', { mode: 0o600 });
|
||||
fs.chmodSync(this.dataFilePath, 0o600);
|
||||
}
|
||||
adapter = new FileSync(this.dataFilePath);
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user