Eliminate TOCTOU problem in creating bbTmp.
This commit is contained in:
parent
2ffb4b96cb
commit
a27a9dc2af
|
@ -18,8 +18,12 @@ export const ObjectStoreBuckets = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const bbTmp = join(tmpdir(), ".budibase")
|
const bbTmp = join(tmpdir(), ".budibase")
|
||||||
if (!fs.existsSync(bbTmp)) {
|
try {
|
||||||
fs.mkdirSync(bbTmp)
|
fs.mkdirSync(bbTmp)
|
||||||
|
} catch (e: any) {
|
||||||
|
if (e.code !== "EEXIST") {
|
||||||
|
throw e
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function budibaseTempDir() {
|
export function budibaseTempDir() {
|
||||||
|
|
Loading…
Reference in New Issue