简体   繁体   中英

how can I run a sandboxed OS X app without sandboxing?

I have an app which runs using sandboxing. How can I run it without sandboxing? Suppose I can't just recompile the app with sandboxing off.

This works:

$ ditto MySandboxedApp.app MySandboxedApp.backup.app
$ codesign -f -s- MySandboxedApp.app

Note the extra minus in "-s-".

There are many ways that all do conceptually the same thing - make sandbox_init a no-op. For example you can use gdb for this, set breakpoint on sandbox_init and return from the function right away. Or you could preload a library containing an empty sandbox_init with DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=foo.dylib where foo.dylib just contains int sandbox_init() { return 0; } int sandbox_init() { return 0; } .

Note that sandboxing is voluntary and if you run an app outside a sandbox as designed you're making your system more vulnerable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM