1234567891011121314151617181920212223 |
- import ctypes
- import os
- import sys
- import json
- import time
- import traceback
- # setup sys.excepthook
- def excepthook(type, value, tb):
- sys.stderr.write("".join(traceback.format_exception(type, value, tb)))
- sys.stderr.flush()
- sys.exit(-1)
- sys.excepthook = excepthook
- lib = ctypes.CDLL("./tmp/sandbox-python/python.so")
- lib.DifySeccomp.argtypes = [ctypes.c_uint32, ctypes.c_uint32, ctypes.c_bool]
- lib.DifySeccomp.restype = None
- {{preload}}
- lib.DifySeccomp({{uid}}, {{gid}}, {{enable_network}})
- {{code}}
|