sandbox

Limiting execution time of embedded Python

夙愿已清 提交于 2019-12-04 01:21:35
If I embed the Python interpreter in a C or C++ program, as in this example , is there any way to limit how long the interpreter runs for? Is there anything to stop the Python code from entering an infinite loop and thus preventing PyObject_CallObject (or equivalent) from ever returning? Similarly, if the Python code creates a new thread, is there anything to stop this thread from entering an infinite loop and running forever? Peter Brittain As you can see in the docs , PyObject_CallObject has no mechanism for limiting how long the function runs. There is also no Python C API function that I

Alternatives for CGEventPostToPSN() for activating an other app's menu item in a sandboxed environment?

梦想与她 提交于 2019-12-03 22:40:54
I have this app where I need to activate an other app's menu item (like Print cmd+p) from within my app. Right now I'm using CGEventPostToPSN() to do the job and it works fine, but when I activate sandboxing, it stops working. CGEventPostToPSN(&psn, keyDownEvent); CFRelease(keyDownEvent); CGEventPostToPSN(&psn, keyUpEvent); CFRelease(keyUpEvent); My question now is what can I do when I need to enable sandboxing? I heard a lot about the Accessibility API but I was unable to find out how I can activate an other app's menu item. I'm thankful for any answer on this problem. Fabian In a sandboxed

Rhino: restrict Java packages that can be accessed from JavaScript

孤街醉人 提交于 2019-12-03 17:52:16
问题 When embedding a JavaScript interpreter (Rhino) into a Java application (to be able to script that application), how would one go about restricting the Java packages that are available to scripts? For example, only "java.lang.*" should be accessible. 回答1: A method for blocking access to certain packages and classes (including through reflection) in Rhino is described here. The important interface is ClassShutter which provides access control for Rhino's LiveConnect support. 回答2: how about

What is the entitlement to allow reading of file in a Mac OS X App? (deny file-read-data error)

强颜欢笑 提交于 2019-12-03 17:18:55
I am making a Mac OS X App (sandboxed) which reads from an installed config file in /etc/myfolder. When I am trying to read the file using NSFileHandle, I am getting the following error in Console: sandboxd: ([3251]) MyApp(3251) deny file-read-data /private/etc/myfolder/myconfig.conf I have set the following entitlements in my Entitilements file, but I still get denied by sandboxd. com.apple.security.temporary-exception.files.home-relative-path.read-only com.apple.security.temporary-exception.files.absolute-path.read-only com.apple.security.files.user-selected.read-only EDIT: It seems that I

Reading NSUserDefaults from helper app in the sandbox

混江龙づ霸主 提交于 2019-12-03 16:44:33
I found some resources on reading the NSUserDefaults of another application. Objective-C NSUserDefaults caching prevents another app from accurately reading changes NSUserDefaults: Is it possible to get userDefaults from another app? Apparently, it's not possible. However the questions firstly relate to iOS, and secondly the two apps are completely different. I have a LaunchAtLogin helper app. But it does some other tasks too. Therefore, the helper app should run always, but only start the main app if the BOOL in the NSUserDefaults is set. Is there a way I can achieve that? Since 10.7.4 you

Paypal Sandbox payment state pending

佐手、 提交于 2019-12-03 16:08:28
I am using the (Java) Rest API to perform payments directly from credit cards in the sandbox. The payments all receive "pending" status, which according to the docs ( https://developer.paypal.com/webapps/developer/docs/api/#create-a-payment ) is not even a valid state to be returned by the payment create call. Payment review is disabled. I would like to see the process through and complete the transaction. How do I do that in the sandbox? Or should I receive a different state right away? Under http://developer.paypal.com , Application tab, find out the email associated to the REST app. Now

iOS in app-purchase receipt validation - sandbox vs production url?

十年热恋 提交于 2019-12-03 15:27:01
I followed Ray Wenderlich's tutorial to implement receipt validation in my app. The code connects to Apple's validation server directly from my app rather than going through my own server. After I submitted my first binary to the AppStore, I tested my app and the in-app purchasing didn't work because I had switched it over from the sandbox URL to the production URL. Will this also fail when they AppStore reviewers test it and therefore be rejected? I've read this post but I'm still very confused about whether that applies to me if I'm not using my own server. The solution is quite simple and

Running plugins in a sandbox

允我心安 提交于 2019-12-03 13:10:46
I am designing a system in C/C++ which is extendible with all sort of plugins. There is a well defined C public API which mostly works with (const) char* and other pointer types. The plugins are compiled into .so or .dll files, and the main application loads them upon startup, and later unloads or reloads them upon request. The plugins might come in from various sources, trustable or not so :) Now, I would like to make sure, that if one plugin does something stupid (such as tries to free a memory which he was not supposed to free), this action does not bring down the entire system, but merely

How to launch another process in sandbox on Mac?

浪子不回头ぞ 提交于 2019-12-03 12:59:49
I'd like to launch another own application by LSOpenApplication() in Sandbox on Mac. Of course, I added a row into 'com.apple.security.temporary-exception.files.absolute-path.read-write' in an entitlements file for launching. However, when launching, console spat out an error which is Not allowing process xxxx to launch "foo.app" because it has not been launched previously by the user. It is able to launch without errors after launched the process manually once. How can I launch the process even if not launch previously? Is this no relation with sandboxing? rudy There are very few conditions

Why cabal sandbox init does not change PATH like virtualenv does?

荒凉一梦 提交于 2019-12-03 12:37:40
Haskell newbie and Python guy here. I think I may be missing something here but if you look at Yesod's quickstart , the autor install some packages before cabal sandbox init . I have seen the same pattern elsewhere. Questions: Am I missing something? Is this the real way to use cabal sandbox? Why can't (or shouldn't) I install yesod-bin inside a sandbox? What if I use different versions of yesod-bin throughout some projects? If there is some libraries that install binaries inside .cabal-sandbox/bin, why cabal sandbox init don't change PATH in order to match the sandboxed version? Thank you