(path: string)
| 224 | } |
| 225 | |
| 226 | async function ensureSocketParent(path: string): Promise<void> { |
| 227 | const dir = dirname(path) |
| 228 | try { |
| 229 | const stat = await lstat(dir) |
| 230 | if (!stat.isDirectory() || stat.isSymbolicLink()) { |
| 231 | throw new Error(`[udsMessaging] socket parent is not a directory: ${dir}`) |
| 232 | } |
| 233 | assertPrivateDirectory(stat, dir, 'socket parent') |
| 234 | return |
| 235 | } catch (error) { |
| 236 | if (!isNotFound(error)) throw error |
| 237 | } |
| 238 | |
| 239 | await mkdir(dir, { recursive: true, mode: 0o700 }) |
| 240 | await chmod(dir, 0o700) |
| 241 | } |
| 242 | |
| 243 | async function writeCapabilityFile( |
| 244 | socket: string, |
no test coverage detected