Exclude symlink devices

This commit is contained in:
2026-09-28 09:41:41 +02:00
parent a7763a3b35
commit 33929c8ad6
+2 -2
View File
@@ -39,7 +39,7 @@ proc getSandboxPath*(name: string): string =
proc deviceExists(path: string): bool = proc deviceExists(path: string): bool =
var res: Stat var res: Stat
return stat(path, res) >= 0 and S_ISCHR(res.st_mode) return stat(path, res) >= 0 and S_ISCHR(res.st_mode) and getFileInfo(path, false).kind == pcFile
proc mountDriFolder(call: var BwrapCall, path: string) = proc mountDriFolder(call: var BwrapCall, path: string) =
for file in walkPattern(&"{path}/*"): for file in walkPattern(&"{path}/*"):
@@ -71,4 +71,4 @@ proc enableDri*(call: var BwrapCall) =
let device = &"/dev/nvidia{i}" let device = &"/dev/nvidia{i}"
if deviceExists(device): if deviceExists(device):
call.addMount("--dev-bind", device) call.addMount("--dev-bind", device)