(path: string)
| 39 | * mount, must not stop the server booting over a permission it cannot set. |
| 40 | */ |
| 41 | const restrictDbFilePermissions = (path: string): void => { |
| 42 | if (path === ":memory:") return; |
| 43 | const base = resolve(path); |
| 44 | for (const suffix of DB_FILE_SUFFIXES) { |
| 45 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: chmod on a file that may not exist yet or a filesystem without POSIX modes; hardening must never block boot |
| 46 | try { |
| 47 | chmodSync(`${base}${suffix}`, 0o600); |
| 48 | } catch { |
| 49 | // Sidecars only exist once WAL has been used, and not every filesystem |
| 50 | // supports chmod. Either way the open proceeds. |
| 51 | } |
| 52 | } |
| 53 | }; |
| 54 | |
| 55 | /** |
| 56 | * Open a libSQL client for a local on-disk DB and apply the per-connection |
no test coverage detected