about summary refs log blame commit diff stats
path: root/src/utils/sandbox.nim
blob: 88fc5c10c1e5b921ab7bdf4d5762fab685a7de64 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                            
when defined(freebsd):
  import bindings/capsicum

when defined(freebsd):
  proc enterSandbox*() =
    # per man:cap_enter(2), it may return ENOSYS if the kernel was compiled
    # without CAPABILITY_MODE. So it seems better not to panic in this case.
    # (But TODO: when we get enough sandboxing coverage it should print a
    # warning or something.)
    discard cap_enter()
else:
  proc enterSandbox*() =
    discard