Exclude symlink devices
This commit is contained in:
+2
-2
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user