Message201936
I'm running Python 2.7 in a sandboxed OS X app. There are restrictions on the naming of POSIX semaphores when running in the sandbox. Specifically, there is a mandatory prefix.
I would like the ability to inject this prefix into the part of the multiprocessing module that creates the semaphore, perhaps by way of an environment variable.
I see that this is how the module generates the semaphore name:
PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d", (long)getpid(), counter++);
Apple's documentation about the restrictions are here:
https://developer.apple.com/library/mac/documentation/security/conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24
The relevant part:
"POSIX semaphores and shared memory names must begin with the application group identifier, followed by a slash (/), followed by a name of your choosing."
So if I could inject that string before the leasing slash, I could make this work. |
|
Date |
User |
Action |
Args |
2013-11-01 19:53:28 | Marc.Liyanage | set | recipients:
+ Marc.Liyanage, jnoller, sbt |
2013-11-01 19:53:28 | Marc.Liyanage | set | messageid: <1383335608.62.0.190972038385.issue19478@psf.upfronthosting.co.za> |
2013-11-01 19:53:28 | Marc.Liyanage | link | issue19478 messages |
2013-11-01 19:53:28 | Marc.Liyanage | create | |
|