feat(runtime): add native office preview and download plugin
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
"""Apply process limits before executing a trusted conversion helper."""
|
||||
import os
|
||||
import resource
|
||||
import sys
|
||||
|
||||
memory, file_bytes, *command = sys.argv[1:]
|
||||
resource.setrlimit(resource.RLIMIT_AS, (int(memory), int(memory)))
|
||||
resource.setrlimit(resource.RLIMIT_FSIZE, (int(file_bytes), int(file_bytes)))
|
||||
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
|
||||
os.execv(command[0], command)
|
||||
Reference in New Issue
Block a user