Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -42,10 +42,12 @@ /*! * @protocol OFApplicationDelegate OFApplication.h ObjFW/OFApplication.h * * @brief A protocol for delegates of OFApplication. + * + * @note Signals are not available on AmigaOS! */ @protocol OFApplicationDelegate /*! * @brief A method which is called when the application was initialized and is * running now. @@ -136,11 +138,12 @@ void (*_Nullable _SIGHUPHandler)(id, SEL); void (*_Nullable _SIGUSR1Handler)(id, SEL); void (*_Nullable _SIGUSR2Handler)(id, SEL); #endif #ifdef OF_HAVE_SANDBOX - OFSandbox *_Nullable _activeSandbox, *_Nullable _activeExecSandbox; + OFSandbox *_Nullable _activeSandbox; + OFSandbox *_Nullable _activeSandboxForChildProcesses; #endif } #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nullable, nonatomic) @@ -179,15 +182,14 @@ * @brief The sandbox currently active for this application. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFSandbox *activeSandbox; /*! - * @brief The sandbox currently active for `exec()`'d processes of this - * application. + * @brief The sandbox currently active for child processes of this application. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) - OFSandbox *activeExecSandbox; + OFSandbox *activeSandboxForChildProcesses; #endif /*! * @brief Returns the only OFApplication instance in the application. * @@ -233,22 +235,22 @@ * @brief Activates the specified sandbox for the application. * * This is only available if `OF_HAVE_SANDBOX` is defined. * * @warning If you allow `exec()`, but do not call - * @ref activateSandboxForExecdProcesses, an `exec()`'d process does not have - * its permissions restricted! + * @ref activateSandboxForChildProcesses, an `exec()`'d process does + * not have its permissions restricted! * * @note Once a sandbox has been activated, you cannot activate a different * sandbox. You can however change the active sandbox and reactivate it. * * @param sandbox The sandbox to activate */ + (void)activateSandbox: (OFSandbox *)sandbox; /*! - * @brief Activates the specified sandbox for `exec()`'d processes of the + * @brief Activates the specified sandbox for child processes of the * application. * * This is only available if `OF_HAVE_SANDBOX` is defined. * * `unveiledPaths` on the sandbox must *not* be empty, otherwise an @@ -257,11 +259,11 @@ * @note Once a sandbox has been activated, you cannot activate a different * sandbox. You can however change the active sandbox and reactivate it. * * @param sandbox The sandbox to activate */ -+ (void)activateSandboxForExecdProcesses: (OFSandbox *)sandbox; ++ (void)activateSandboxForChildProcesses: (OFSandbox *)sandbox; #endif - (instancetype)init OF_UNAVAILABLE; /*! @@ -290,22 +292,22 @@ * @brief Activates the specified sandbox for the application. * * This is only available if `OF_HAVE_SANDBOX` is defined. * * @warning If you allow `exec()`, but do not call - * @ref activateSandboxForExecdProcesses, an `exec()`'d process does not have - * its permissions restricted! + * @ref activateSandboxForExecdProcesses, an `exec()`'d process does + * not have its permissions restricted! * * @note Once a sandbox has been activated, you cannot activate a different * sandbox. You can however change the active sandbox and reactivate it. * * @param sandbox The sandbox to activate */ - (void)activateSandbox: (OFSandbox *)sandbox; /*! - * @brief Activates the specified sandbox for `exec()`'d processes of the + * @brief Activates the specified sandbox for child processes of the * application. * * This is only available if `OF_HAVE_SANDBOX` is defined. * * `unveiledPaths` on the sandbox must *not* be empty, otherwise an @@ -314,11 +316,11 @@ * @note Once a sandbox has been activated, you cannot activate a different * sandbox. You can however change the active sandbox and reactivate it. * * @param sandbox The sandbox to activate */ -- (void)activateSandboxForExecdProcesses: (OFSandbox *)sandbox; +- (void)activateSandboxForChildProcesses: (OFSandbox *)sandbox; #endif @end #ifdef __cplusplus extern "C" { Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -154,11 +154,11 @@ @implementation OFApplication @synthesize programName = _programName, arguments = _arguments; @synthesize environment = _environment; #ifdef OF_HAVE_SANDBOX @synthesize activeSandbox = _activeSandbox; -@synthesize activeExecSandbox = _activeExecSandbox; +@synthesize activeSandboxForChildProcesses = _activeSandboxForChildProcesses; #endif + (OFApplication *)sharedApplication { return app; @@ -203,13 +203,13 @@ + (void)activateSandbox: (OFSandbox *)sandbox { [app activateSandbox: sandbox]; } -+ (void)activateSandboxForExecdProcesses: (OFSandbox *)sandbox ++ (void)activateSandboxForChildProcesses: (OFSandbox *)sandbox { - [app activateSandboxForExecdProcesses: sandbox]; + [app activateSandboxForChildProcesses: sandbox]; } #endif - (instancetype)init { @@ -628,17 +628,18 @@ if (_activeSandbox == nil) _activeSandbox = [sandbox retain]; # endif } -- (void)activateSandboxForExecdProcesses: (OFSandbox *)sandbox +- (void)activateSandboxForChildProcesses: (OFSandbox *)sandbox { # ifdef OF_HAVE_PLEDGE void *pool = objc_autoreleasePoolPush(); const char *promises; - if (_activeExecSandbox != nil && sandbox != _activeExecSandbox) + if (_activeSandboxForChildProcesses != nil && + sandbox != _activeSandboxForChildProcesses) @throw [OFInvalidArgumentException exception]; if (sandbox.unveiledPaths.count != 0) @throw [OFInvalidArgumentException exception]; @@ -650,11 +651,11 @@ exceptionWithSandbox: sandbox errNo: errno]; objc_autoreleasePoolPop(pool); - if (_activeExecSandbox == nil) - _activeExecSandbox = [sandbox retain]; + if (_activeSandboxForChildProcesses == nil) + _activeSandboxForChildProcesses = [sandbox retain]; # endif } #endif @end