603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
#ifdef OF_HAVE_SANDBOX
- (void)of_activateSandbox: (OFSandbox *)sandbox
{
# ifdef OF_HAVE_PLEDGE
void *pool = objc_autoreleasePoolPush();
OFStringEncoding encoding = [OFLocale encoding];
OFArray OF_GENERIC(of_sandbox_unveil_path_t) *unveiledPaths;
size_t unveiledPathsCount;
const char *promises;
if (_activeSandbox != nil && sandbox != _activeSandbox)
@throw [OFInvalidArgumentException exception];
unveiledPaths = sandbox.unveiledPaths;
unveiledPathsCount = unveiledPaths.count;
for (size_t i = sandbox->_unveiledPathsIndex;
i < unveiledPathsCount; i++) {
of_sandbox_unveil_path_t unveiledPath =
[unveiledPaths objectAtIndex: i];
OFString *path = unveiledPath.firstObject;
OFString *permissions = unveiledPath.secondObject;
if (path == nil || permissions == nil)
@throw [OFInvalidArgumentException exception];
|
|
|
|
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
#ifdef OF_HAVE_SANDBOX
- (void)of_activateSandbox: (OFSandbox *)sandbox
{
# ifdef OF_HAVE_PLEDGE
void *pool = objc_autoreleasePoolPush();
OFStringEncoding encoding = [OFLocale encoding];
OFArray OF_GENERIC(OFSandboxUnveilPath) *unveiledPaths;
size_t unveiledPathsCount;
const char *promises;
if (_activeSandbox != nil && sandbox != _activeSandbox)
@throw [OFInvalidArgumentException exception];
unveiledPaths = sandbox.unveiledPaths;
unveiledPathsCount = unveiledPaths.count;
for (size_t i = sandbox->_unveiledPathsIndex;
i < unveiledPathsCount; i++) {
OFSandboxUnveilPath unveiledPath =
[unveiledPaths objectAtIndex: i];
OFString *path = unveiledPath.firstObject;
OFString *permissions = unveiledPath.secondObject;
if (path == nil || permissions == nil)
@throw [OFInvalidArgumentException exception];
|